view Makefile @ 451:621313775834 stable-1.9.3-1

only build arm package
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Mar 2016 15:51:03 -0700
parents 5a74f1b7c1db
children 7492d2cb7b75
line wrap: on
line source

#mc40 is "On Device Storage"
#tc55 is "Internal Storage"

style:=release
dest:=/run/user/1000/gvfs/mtp*/*torage/Download
apk:='app/build/outputs/apk/510Connectbot-$(style).apk'
ver:=$(shell grep versionName app/src/main/AndroidManifest.xml | cut -d'"' -f2)
id:=$(shell hg id --id || echo 1)
da:=$(shell date +%Y-%m-%d)
version:=\
<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
<resources>\n\
	<string name=\"msg_version\" translatable=\"false\">510Connectbot $(ver) ($(id) $(da))</string>\n\
</resources>\n

ifeq ($(style),release)
    task:=assembleArmRelease
else
	task:=assembleArmDebug
endif


all:
	hg pull; hg update
	make builder

builder: prep
	rm -rf app/build/*
	echo -e "$(version)" >app/src/main/res/values/version.xml
	cat app/src/main/res/values/version.xml
	./gradlew $(task)
	mv app/build/outputs/apk/app-arm-$(style).apk $(apk)
	ls -al app/build/outputs/apk

prep:
	(cd help; make)

genkey:
	keytool -genkeypair -keystore 510Connectbot.keystore -alias 510Connectbot -dname "cn=510Connectbot , ou=510Connectbot, o=five-ten-sg, o=com, c=US" -keyalg RSA -keysize 2048 -validity 10000

docs:
	(cd xml; make)
	(cd help; make)

install:
	cp $(apk) $(dest)
	ls -al $(apk) $(dest)

buildicon:
	convert base.510.icon.png -background white -resize 500x500 -extent 1024x500 google.play.store/feature.510.icon.png
	cp -a   base.510.icon.png                 app/src/main/res/drawable-xxxhdpi/icon.png
	convert base.510.icon.png -resize 144x144 app/src/main/res/drawable-xxhdpi/icon.png
	convert base.510.icon.png -resize 96x96   app/src/main/res/drawable-xhdpi/icon.png
	convert base.510.icon.png -resize 72x72   app/src/main/res/drawable-hdpi/icon.png
	convert base.510.icon.png -resize 48x48   app/src/main/res/drawable-mdpi/icon.png
	convert base.510.icon.png -resize 36x36   app/src/main/res/drawable-ldpi/icon.png

	convert app/src/main/res/drawable-xxxhdpi/icon.png -resize 50% -colorspace Gray app/src/main/res/drawable-xxxhdpi/notification_icon.png
	convert app/src/main/res/drawable-xxhdpi/icon.png  -resize 50% -colorspace Gray app/src/main/res/drawable-xxhdpi/notification_icon.png
	convert app/src/main/res/drawable-xhdpi/icon.png   -resize 50% -colorspace Gray app/src/main/res/drawable-xhdpi/notification_icon.png
	convert app/src/main/res/drawable-hdpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-hdpi/notification_icon.png
	convert app/src/main/res/drawable-mdpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-mdpi/notification_icon.png
	convert app/src/main/res/drawable-ldpi/icon.png    -resize 50% -colorspace Gray app/src/main/res/drawable-ldpi/notification_icon.png

indentc:
	indent --line-length100 \
		   --brace-indent4 \
		   --braces-on-if-line \
		   --braces-on-func-def-line \
		   --case-brace-indentation4 \
		   --case-indentation4 \
		   --comment-indentation60 \
		   --cuddle-else \
		   --declaration-comment-column60 \
		   --no-tabs \
		   -nbbo \
		   -npcs \
		   -nprs \
		   -npsl \
		   -saf -sai -saw \
		   -i4 \
		   $(shell find . -iname *.c -o -iname *.h -o -iname *.cpp)


indentjava:
	astyle --style=java \
		--attach-namespaces \
		--attach-classes \
		--indent-classes \
		--indent-switches \
		--indent-cases \
		--indent-namespaces \
		--break-blocks \
		--unpad-paren \
		--pad-oper \
		--pad-header \
		--delete-empty-lines \
		--align-pointer=type \
		--break-closing-brackets \
		--keep-one-line-blocks \
		--keep-one-line-statements \
		--convert-tabs \
		--break-after-logical \
		--mode=java \
		   $(shell find . -iname *.java | grep -v /gen/)

internaldocs:
	doxygen