diff --git a/.gitignore b/.gitignore index 759b7ca..11c7eb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ /Dockerfile -/app/result /app/result/* -/app/obj +!/app/result/.gitkeep /app/obj/* -/app/bin -/app/bin/* +!/app/obj/.gitkeep /app/app.apk diff --git a/app/Makefile b/app/Makefile index 642a9c5..1f6b411 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,4 +1,5 @@ .ONESHELL: + SHELL=/bin/makefile-bash-wrapper.sh # symlink @@ -21,17 +22,18 @@ SHELL=/bin/makefile-bash-wrapper.sh -storepass armena -keypass armena -alias helljniKey -keyalg RSA -v # aapt "package" together the dalvik/hex stuff (and "assets" and "res") -./result/unsigned.apk : ./bin/classes.dex ./result ./assets ./bin ./AndroidManifest.xml +./result/unsigned.apk : ./result/bin/classes.dex ./assets ./AndroidManifest.xml rm -rvf "$@" source app-config.sh; $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.buildtools.version.current)/aapt package \ -v -u -f -M ./AndroidManifest.xml -S ./res \ - -I $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.platforms.version.current)/android.jar -A ./assets -F $@ ./bin + -I $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.platforms.version.current)/android.jar -A ./assets -F $@ ./result/bin # convert "java class"es files (i.e bytecode to dalvic/d8 android thing -./bin/classes.dex : ./obj/package ./obj/package/AppActivity.class ./bin +./result/bin/classes.dex : ./obj/package/AppActivity.class + mkdir -p ./result/bin ls ./obj/package/*.class source app-config.sh; $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.buildtools.version.current)/d8 $$(realpath --relative-to=. $<)/*.class \ - --lib $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.platforms.version.current)/android.jar --output bin + --lib $${ANDROID_SDK_ROOT}/$$(tr ';' '/' < android-sdk/.installed.platforms.version.current)/android.jar --output ./result/bin # compile (javac) the class from ./obj/package/AppActivity.class : ./src/package/AppActivity.java ./src/package/R.java ./obj/package @@ -39,7 +41,7 @@ SHELL=/bin/makefile-bash-wrapper.sh -sourcepath ./src $$(realpath --relative-to=/src $<) # generate teh AppActivity.java (template) -./src/package/AppActivity.java: ./src/package app-config.sh +./src/package/AppActivity.java: app-config.sh ./.Makefile.scripts/make--AppActivity.java.sh > $@ # make the resources "R.java" thing @@ -56,19 +58,23 @@ SHELL=/bin/makefile-bash-wrapper.sh ./AndroidManifest.xml: app-config.sh ./.Makefile.scripts/make--AndroidManifest.xml -# recipe to make directories (if) needed -./result ./bin ./assets ./src/ ./obj: - mkdir -p "$@" +app/.s: + source app-config.sh -# make symlinksa and directories (to cater for the "helpful" java thing, to use folders for package names and yes we need a package name :( ) -./src/package: app-config.sh - set -x; source app-config.sh; PKGDIR=$$(echo "$$APP_PACKAGE" | tr '.' '/'); mkdir -p src/$$PKGDIR; rm -rf $@ ; ln -sfrv src/$$PKGDIR $@ - -./obj/package: app-config.sh - source app-config.sh; PKGDIR=$$(echo "$$APP_PACKAGE" | tr '.' '/'); mkdir -p obj/$$PKGDIR; rm -rf $@; ln -sfrv obj/$$PKGDIR $@ app-config.sh: ./.Makefile.scripts/make--app-config.sh + # make symlinks and directories (to cater for the "helpful" java thing, to use folders for package names and yes we need a package name :( ) + #source app-config.sh + #PKGDIR=$$(echo "$$APP_PACKAGE" | tr '.' '/') + #for DIR in src obj + #do + # mkdir -p $$DIR/$$PKGDIR + # ln -snfrv $$DIR/$$PKGDIR $$DIR/package + #done +clean: + rm -rf obj/* + rm -rf result/* FORCE: @true diff --git a/app/obj/.gitkeep b/app/obj/.gitkeep new file mode 100644 index 0000000..e69de29