Add linux arm target to project makefile.
[fltk_mvc_template.git] / _template / packages / fltk1.3 / Makefile
index ac2e28f..b40a6b0 100644 (file)
@@ -6,16 +6,22 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: unpack windows clean linux
+# Add android ndk toolchain
+export PATH := /usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
+
+all: unpack windows linux android_arm
 
 .PHONY: unpack
 unpack:
        tar xvzf fltk-1.3.4-1-source.tar.gz
        cd $(WORKDIR)/fltk-1.3.4-1
+       cp /usr/include/X11/Xmd.h ../../include/X11/
+       cp /usr/include/X11/cursorfont.h ../../include/X11/
 
 .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
@@ -26,17 +32,21 @@ 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; \
-       ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --enable-static --x-includes=../../../../include/X11  --x-libraries=../../../../lib/linux32 --enable-localjpeg --enable-localzlib --enable-localpng --disable-gl --disable-xinerama --disable-xft --disable-xdbe --disable-xfixes --disable-xcursor --disable-xrender; \
+       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; \
        sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/Fl_x.cxx; \
@@ -47,7 +57,22 @@ linux_nanox:
        cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
        cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/*.a $(WORKDIR)/../../lib/linux32
 
+.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; \
+       sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/Fl_x.cxx; \
+       sed -i -e '/#define USE_XRANDR/ a #undef USE_XRANDR' ./src/screen_xywh.cxx; \
+       sed -i -e 's/char \*pc_dl_error/const char \*pc_dl_error/g' ./src/Fl_Native_File_Chooser_GTK.cxx; \
+       make -i -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/fltk-1.3.4-1/FL $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/fltk-1.3.4-1/lib/*.a $(WORKDIR)/../../lib/android_arm
+
 .PHONY: clean
 clean:
-       cd $(WORKDIR)/fltk-1.3.4-1; \
-       make clean
+       rm -rf $(WORKDIR)/fltk-1.3.4-1