keys.scala, etc.: Make merging public keys have a progress bar.
[tripe-android] / Makefile
index 7982820..d077faf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ CCACHE                        := $(shell \
 
 ## Where to put the object files.
 OUTDIR                  = out
-CONFIGDIR               = $(OUTDIR)/config
+CONFIGDIR               = $(OUTDIR)/config-$(hostcpu)
 
 ## The Java runtime, for some reason, hardcodes its default for
 ## `java.io.tmpdir', inviting security problems.  If the user has defined a
@@ -97,13 +97,13 @@ CFLAGS                       = -O2 -g -Wall
 LDFLAGS                         = -Wl,-z,defs
 
 ## Host toolchain.
-FLAVOURS               += host
-ENV.host                =
-CC.host                         = gcc
-CFLAGS.host             = $(CFLAGS) -fPIC
-LD.host                         = $(CC.host)
-LDFLAGS.host            = $(LDFLAGS)
-CONFIG.host             =
+FLAVOURS               += host-$(hostcpu)
+ENV.host-$(hostcpu)     =
+CC.host-$(hostcpu)      = gcc
+CFLAGS.host-$(hostcpu)  = $(CFLAGS) -fPIC
+LD.host-$(hostcpu)      = $(CC.host-$(hostcpu))
+LDFLAGS.host-$(hostcpu)         = $(LDFLAGS)
+CONFIG.host-$(hostcpu)  =
 
 ## Host JNI machinery.
 $(CONFIGDIR)/jdkdir.mk:
@@ -119,7 +119,7 @@ JDKPLAT                     := $(shell \
          (darwin) echo macosx ;; \
          (*) echo $(hostos) ;; \
        esac)
-CFLAGS.host            += -I$(JDKDIR)/include -I$(JDKDIR)/include/$(JDKPLAT)
+CFLAGS.host-$(hostcpu) += -I$(JDKDIR)/include -I$(JDKDIR)/include/$(JDKPLAT)
 
 ## Android SDK location.
 ANDROID_SDKDIR          = /usr/local/android/sdk
@@ -129,12 +129,12 @@ TOOLVERSION                = 4.9
 
 ## Android ABI definitions.  We don't bother with `armeabi-v7a': we'll use
 ## fancy CPU features if we detect that they're available at runtime anyway.
-#ANDROID_ABIS          += armeabi
+ANDROID_ABIS           += armeabi
 GNUARCH.armeabi                 = arm-linux-androideabi
 PLATARCH.armeabi        = arm
 CFLAGS.ndk-armeabi      =
 
-#ANDROID_ABIS          += arm64-v8a
+ANDROID_ABIS           += arm64-v8a
 GNUARCH.arm64-v8a       = aarch64-linux-android
 PLATARCH.arm64-v8a      = arm64
 MINAPI.arm64-v8a        = 21
@@ -144,7 +144,7 @@ TOOLCHAINDIR.x86     = x86
 GNUARCH.x86             = i686-linux-android
 PLATARCH.x86            = x86
 
-#ANDROID_ABIS          += x86_64
+ANDROID_ABIS           += x86_64
 TOOLCHAINDIR.x86_64     = x86_64
 GNUARCH.x86_64          = x86_64-linux-android
 PLATARCH.x86_64                 = x86_64
@@ -354,7 +354,8 @@ libtripe.so_LIBS     = $(call ext-builddir,$1,tripe)/server/libtripe.a \
                                $(call ext-builddir,$1,tripe)/common/libcommon.a \
                                -L$(call ext-prefix,$1)/lib \
                                $(call pkg-config,$1,catacomb,LIBS) \
-                               $(call pkg-config,$1,mLib,LIBS)
+                               $(call pkg-config,$1,mLib,LIBS) \
+                               -ladns
 
 ## Machinery for compiling.
 objdir                  = $(OUTDIR)/obj.$1
@@ -386,7 +387,7 @@ $(foreach a,$(APKLIBS), $(eval $(call obj-rule,$a)))
 CLEANFILES             += $(OUTDIR)/obj.*/*.o $(OUTDIR)/obj.*/*.d
 
 ## Machinery for linking.
-JNIDIR.host             = $(OUTDIR)
+JNIDIR.host-$(hostcpu)  = $(OUTDIR)/lib.host-$(hostcpu)
 JNIDIR.ndk              = $(OUTDIR)/pkg/lib/$1
 
 define apklib-rule
@@ -404,7 +405,8 @@ $(foreach f,$(FLAVOURS), \
 $(foreach a,$(APKLIBS), \
        $(eval $(call apklib-rule,$f,$a))))
 
-CLEANFILES             += $(OUTDIR)/pkg/lib/*/lib*.so $(OUTDIR)/lib*.so
+CLEANFILES             += $(OUTDIR)/pkg/lib/*/lib*.so
+CLEANFILES             += $(OUTDIR)/lib.host-$(hostcpu)/lib*.so
 
 ###--------------------------------------------------------------------------
 ### Android string resource generation.
@@ -473,7 +475,8 @@ CLASSES                     += progress:sys,util
 CLASSES                        += keys:progress,tar,sys,util
 CLASSES                        += terminal:progress,sys,util
 CLASSES                        += R
-CLASSES                        += toy-activity:R
+CLASSES                        += app:R
+CLASSES                        += toy-activity:app,R
 
 ## Building class files.
 $(STAMPDIR)/%.class-stamp: %.java
@@ -581,8 +584,9 @@ all:: debug
 clean::; rm -f $(CLEANFILES)
 realclean::; rm -f $(REALCLEANFILES)
 
-repl: $(CLASSSTAMPS) $(foreach a,$(APKLIBS),$(OUTDIR)/$a)
-       $(SCALA) -cp $(CLASSDIR) -Djava.lib.path=$(OUTDIR) -Yno-load-impl-class
+repl: $(CLASSSTAMPS) $(foreach a,$(APKLIBS),$(JNIDIR.host-$(hostcpu))/$a)
+       $(SCALA) -cp $(CLASSDIR) -Yno-load-impl-class \
+               -Djava.library.path=$(JNIDIR.host-$(hostcpu)) \
 
 t:; : $(show)
 .PHONY: t