Use readme instead of .keepdir
[fltk_mvc_template.git] / _template / packages / nanox / Makefile
1 ############################################################################
2 # Workfile: Makefile
3 # Author: Daniel Giritzer, S1810567004 (daniel@giritzer.eu)
4 # Date: 03.12.2018
5 # Description: Universal Makefile for Unix based Operating Systems
6 ############################################################################
7 WORKDIR = $(shell pwd)
8 ANDROID_TARGET_VER=23
9
10
11 all: unpack android_arm
12
13 unpack:
14         unzip -o microwindows-master.zip
15         rm -rf $(WORKDIR)/microwindows-master/src/demos/nbreaker
16         rm -rf $(WORKDIR)/microwindows-master/src/demos/nanox/cannyedgedetect.cpp
17         sed -i -e "s/TARGETS +=.*demo-convimage/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
18         sed -i -e "s/TARGETS +=.*demo-agg/ /g" $(WORKDIR)/microwindows-master/src/demos/nanox/Makefile
19
20 linux:
21         cp $(WORKDIR)/config_linux $(WORKDIR)/microwindows-master/src/config
22         cd $(WORKDIR)/microwindows-master/src/; \
23         sed -i -e 's/CFLAGS=.*/CFLAGS=-m32/g' ./Makefile.rules; \
24         sed -i -e 's/LDFLAGS=.*/LDFLAGS=-m32/g' ./Makefile.rules; \
25         make -j4
26         mkdir -p $(WORKDIR)/../../lib/linux32
27         mkdir -p $(WORKDIR)/../../include/nanox
28         cp -rf $(WORKDIR)/microwindows-master/src/lib/*.a $(WORKDIR)/../../lib/linux32
29         cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include/nanox
30         cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
31
32 android_arm:
33         cp $(WORKDIR)/config_android_arm $(WORKDIR)/microwindows-master/src/config
34         export PATH=/usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:${PATH}; \
35         cd $(WORKDIR)/microwindows-master/src/; \
36         sed -i -e 's/CFLAGS=.*/CFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\/ -I..\/..\/..\/..\/..\/include/g' ./Makefile.rules; \
37         sed -i -e 's/LDFLAGS=.*/LDFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\//g' ./Makefile.rules; \
38         make -j4
39         mkdir -p $(WORKDIR)/../../lib/android_arm
40         mkdir -p $(WORKDIR)/../../include/nanox
41         cp -rf $(WORKDIR)/microwindows-master/src/lib/*.a $(WORKDIR)/../../lib/android_arm
42         cp -rf $(WORKDIR)/microwindows-master/src/include/*.h $(WORKDIR)/../../include/nanox
43         cp -rf $(WORKDIR)/microwindows-master/src/nx11/X11-local/* $(WORKDIR)/../../include
44
45 clean:
46         rm -rf $(WORKDIR)/microwindows-master