Use 4 jobs to build nanox
[fltk_mvc_template.git] / _template / packages / nanox / Makefile
index dde2e4c..cfb0d64 100644 (file)
@@ -5,10 +5,10 @@
 # Description: Universal Makefile for Unix based Operating Systems
 ############################################################################
 WORKDIR = $(shell pwd)
+ANDROID_TARGET_VER=23
 
-# compiler flags
 
-all: unpack linux
+all: unpack android_arm
 
 unpack:
        unzip -o microwindows-master.zip
@@ -17,12 +17,6 @@ unpack:
        sed -i -e "s/TARGETS +=.*demo-convimage/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
        sed -i -e "s/TARGETS +=.*demo-agg/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
 
-windows: unpack
-       cd $(WORKDIR)/nxlib-master; \
-       make CC='$(CC_WIN)' CFLAGS='$(CFLAGS)'
-       mkdir -p $(WORKDIR)/../../lib/mingw32
-       cp -rf $(WORKDIR)/nxlib-master/*.a $(WORKDIR)/../../lib/mingw32
-
 linux:
        cp $(WORKDIR)/config_linux $(WORKDIR)/microwindows-master/src/config
        cd $(WORKDIR)/microwindows-master/src/; \
@@ -30,10 +24,23 @@ linux:
        sed -i -e 's/LDFLAGS=.*/LDFLAGS=-m32/g' ./Makefile.rules; \
        make -j4
        mkdir -p $(WORKDIR)/../../lib/linux32
+       mkdir -p $(WORKDIR)/../../include/nanox
        cp -rf $(WORKDIR)/microwindows-master/src/lib/*.a $(WORKDIR)/../../lib/linux32
-       cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include/nanox
+       cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
+
+android_arm:
+       cp $(WORKDIR)/config_android_arm $(WORKDIR)/microwindows-master/src/config
+       export PATH=/usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:${PATH}; \
+       cd $(WORKDIR)/microwindows-master/src/; \
+       sed -i -e 's/CFLAGS=.*/CFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\/ -I..\/..\/..\/..\/..\/include  -DHAVE_SELECT=0/g' ./Makefile.rules; \
+       sed -i -e 's/LDFLAGS=.*/LDFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\//g' ./Makefile.rules; \
+       make -j4
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       mkdir -p $(WORKDIR)/../../include/nanox
+       cp -rf $(WORKDIR)/microwindows-master/src/lib/*.a $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include/nanox
        cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
 
 clean:
-       cd $(WORKDIR)/microwindows-master/src; \
-       make clean
+       rm -rf $(WORKDIR)/microwindows-master