final cleanup.
authorDaniel G <giri@nwrk.biz>
Sun, 27 Jan 2019 16:27:33 +0000 (17:27 +0100)
committerDaniel G <giri@nwrk.biz>
Sun, 27 Jan 2019 16:27:33 +0000 (17:27 +0100)
_template/Makefile
_template/packages/fltk1.3/Makefile
_template/packages/nanox/Makefile
_template/src/Makefile
_template/src/android-src/AndroidManifest.xml
_template/src/android-src/java/MainActivity.java

index 6a52f6c..5de5154 100644 (file)
@@ -6,22 +6,43 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: fltk tinyxml _template linux_package windows_package
+all: allegro nanox fltk _template linux_package windows_package android_package
+
+
+#### Dependencies
+allegro:
+       cd $(WORKDIR)/packages/allegro5.1.13; \
+       make
+
+nanox:
+       cd $(WORKDIR)/packages/nanox; \
+       make
 
 fltk:
-       cd $(WORKDIR)/packages/fltk; \
+       cd $(WORKDIR)/packages/fltk1.3; \
        make
 
 tinyxml:
        cd $(WORKDIR)/packages/tinyxml; \
        make
 
+#### _template App
 _template:
        cd $(WORKDIR)/src; \
-       make
+       make -j4
+
+
+#### Clean
+clean_allegro:
+       cd $(WORKDIR)/packages/allegro5.1.13; \
+       make clean
+
+clean_nanox:
+       cd $(WORKDIR)/packages/nanox; \
+       make clean
 
 clean_fltk:
-       cd $(WORKDIR)/packages/fltk; \
+       cd $(WORKDIR)/packages/fltk1.3; \
        make clean
 
 clean_tinyxml:
@@ -34,10 +55,11 @@ clean__template:
 
 clean_lib:
        rm -rf $(WORKDIR)/lib/
-       rm -rf $(WORKDIR)/include/tinyxml2.h
-       rm -rf $(WORKDIR)/include/FL
-       rm -rf $(WORKDIR)/install_package/
+       rm -rf $(WORKDIR)/tools/
+       find $(WORKDIR)/include/ ! -name 'json.h' ! -name '.gitignore' -type f -exec rm -f {} +
+       find $(WORKDIR)/include/ -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
 
+### Create packages
 linux_package:
        mkdir -p $(WORKDIR)/install_package/linux/lib
        mkdir -p $(WORKDIR)/install_package/linux/bin
@@ -57,5 +79,8 @@ windows_package:
        ./gen_package_windows.sh $(WORKDIR)/install_package/windows/*; \
        mv ./*.exe $(WORKDIR)/install_package/install_windows.exe
 
+android_package:
+       mkdir -p $(WORKDIR)/install_package/
+       cp $(WORKDIR)/src/bin/Android/_template.apk $(WORKDIR)/install_package/
 
-clean: clean_lib clean__template clean_fltk clean_tinyxml
+clean: clean_lib clean__template clean_fltk  clean_tinyxml clean_allegro clean_nanox
index 5461b39..b40a6b0 100644 (file)
@@ -21,6 +21,7 @@ unpack:
 .PHONY: windows
 windows:
        cd $(WORKDIR)/fltk-1.3.4-1; \
+       make clean; \
        ./configure CFLAGS="-m32 -mwindows" CXXFLAGS="-m32 -mwindows" LDFLAGS="-m32 -static -static-libgcc -static-libstdc++ -lpthread"  --enable-static --host=i686-w64-mingw32 --enable-cygwin --enable-localjpeg --enable-localzlib --enable-localpng --disable-xcursor --disable-xinerama --disable-xft --disable-xdbe --disable-xrender --disable-xfixes; \
        make -j4
        mkdir -p $(WORKDIR)/../../include
@@ -31,16 +32,20 @@ windows:
 .PHONY: linux
 linux:
        cd $(WORKDIR)/fltk-1.3.4-1; \
+       make clean; \
        ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --enable-static --enable-localjpeg --enable-localzlib --enable-localpng --disable-xcursor --disable-xinerama --disable-xft --disable-xdbe --disable-xrender --disable-xfixes; \
        make -j4
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/linux32
+       mkdir -p $(WORKDIR)/../../tools
        cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
        cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/* $(WORKDIR)/../../lib/linux32
+       cp -rf $(WORKDIR)/fltk-1.3.4-1/fluid/fluid $(WORKDIR)/../../tools
 
 .PHONY: linux_nanox
 linux_nanox:
        cd $(WORKDIR)/fltk-1.3.4-1; \
+       make clean; \
        ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --enable-static --x-includes=../../../../include/  --x-libraries=../../../../lib/linux32 --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --disable-xinerama --disable-xft --disable-xdbe --disable-xfixes --disable-xcursor --disable-xrender; \
        sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./makeinclude; \
        sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./fltk-config; \
@@ -55,6 +60,7 @@ linux_nanox:
 .PHONY: android_arm
 android_arm:
        cd $(WORKDIR)/fltk-1.3.4-1; \
+       make clean; \
        ./configure CFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" CXXFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" LDFLAGS="-static-libgcc -static-libstdc++ --sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" --enable-static  --x-includes=../../../../include/ --x-libraries=../../../../lib/android_arm --host=arm-linux-androideabi --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --disable-xinerama --disable-xft --disable-xdbe --disable-xfixes --disable-xcursor --disable-xrender; \
        sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./makeinclude; \
        sed -i -e 's/-lX11/-lNX11 -lnano-X/g' ./fltk-config; \
index 42c1a2a..7983c1d 100644 (file)
@@ -24,9 +24,9 @@ linux:
        sed -i -e 's/LDFLAGS=.*/LDFLAGS=-m32/g' ./Makefile.rules; \
        make -j4
        mkdir -p $(WORKDIR)/../../lib/linux32
-       mkdir -p $(WORKDIR)/../../include
+       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:
@@ -37,9 +37,9 @@ android_arm:
        sed -i -e 's/LDFLAGS=.*/LDFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-23\/arch-arm\//g' ./Makefile.rules; \
        make -j4
        mkdir -p $(WORKDIR)/../../lib/android_arm
-       mkdir -p $(WORKDIR)/../../include
+       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
+       cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include/nanox
        cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
 
 clean:
index 55e33f1..664d793 100644 (file)
@@ -31,7 +31,7 @@ LIBDIR_GCC = -L$(WORKDIR)/../lib/linux32
 CFLAGS_GCC = -m32 $(CFLAGS)
 RESINC_GCC =
 LDFLAGS_GCC = $(LDFLAGS)
-LIB_GCC = -m32 $(LIB) -lm -lpthread -lX11 -lbsd -lrt -ldl
+LIB_GCC = -m32 $(LIB) -lm -lpthread -lX11 -lxcb -lXau -lXdmcp -lbsd -lrt -Wl,-Bdynamic -ldl
 
 ###################################
 #MinGW | EDIT 3/11
@@ -44,9 +44,9 @@ WINDRES_WIN = i686-w64-mingw32-windres
 
 INC_WIN = $(INC)
 LIBDIR_WIN = -L$(WORKDIR)/../lib/mingw32
-CFLAGS_WIN = -m32  $(CFLAGS) -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS_WIN = -m32  $(CFLAGS) -mwindows -DWIN32 -D_WIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 RESINC_WIN =
-LDFLAGS_WIN =  $(LDFLAGS) -static
+LDFLAGS_WIN =  $(LDFLAGS)
 LIB_WIN = -m32 $(LIB) -mwindows -lole32 -luuid -lcomctl32 -lpthread
 
 ###################################
@@ -55,7 +55,7 @@ LIB_WIN = -m32 $(LIB) -mwindows -lole32 -luuid -lcomctl32 -lpthread
 JAVA_HOME=/usr/lib/jvm/java-1.12.0-openjdk-amd64
 ANDROID_SDK_ROOT=/usr/lib/android-sdk
 ANDROID_NDK_ROOT=/usr/lib/android-ndk
-ANDROID_BUILD_TOOLS_VERSION=25.0.0
+ANDROID_BUILD_TOOLS_VERSION=debian
 ANDROID_PLATORM_VERSION=23
 ANDROID_KEYSTORE_PATH=~/.android/debug.keystore
 ANDROID_KEYSTORE_NAME=androiddebugkey
@@ -102,7 +102,7 @@ LIBDIR_ANDROID += -L$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(ANDRO
 CFLAGS_ANDROID  = $(CFLAGS) --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH) -D_ANDROID
 RESINC_ANDROID =
 LDFLAGS_ANDROID  =  $(LDFLAGS) -shared --sysroot=$(ANDROID_NDK_ROOT)/platforms/$(ANDROID_PLATORM)/arch-$(ANDROID_ARCH)
-LIB_ANDROID  = $(LIB) -lc++ -lNX11 -lnano-X -lm -Wl,-Bstatic -lallegro
+LIB_ANDROID  = $(LIB) -lc++ -lNX11 -lnano-X -lm -Wl,-Bdynamic -lallegro
 
 ###################################
 #RELEASE GCC SETTINGS | EDIT: 6/11
@@ -211,7 +211,7 @@ debug Debug: debug_linux debug_windows debug_android android_apk
 release Release:  release_linux release_windows release_android android_apk
 
 make_fluid:
-       $(WORKDIR)/../packages/fltk/fltk-1.3.4-1/fluid/fluid -c $(WORKDIR)/ViewFluid.fld
+       $(WORKDIR)/../tools/fluid -c $(WORKDIR)/ViewFluid.fld
 
 ######## DEBUG GCC
 before_debug_linux:
index ff5a014..d9516ab 100644 (file)
@@ -1,6 +1,6 @@
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.giri.template">
+    package="com.giri._template">
   <application
       android:label="@string/app_name">
     <activity
index cb5e44b..36d60d8 100644 (file)
@@ -1,4 +1,4 @@
-package com.giri.template;
+package com.giri._template;
 import org.liballeg.android.AllegroActivity;
 public class MainActivity extends AllegroActivity {