Added gl4es for android (openGL to openGLES translation library).
[fltk_mvc_template.git] / _template / 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 APPINFO = $(WORKDIR)/src/appinfo
9
10 all: deps _template create_installers
11 deps: freetype allegro nanox fltk
12 create_installers: linux32_package linux_arm_package windows_package android_package
13
14 #### Dependencies
15 freetype:
16         cd $(WORKDIR)/packages/freetype2.9.1; \
17         make
18
19 allegro:
20         cd $(WORKDIR)/packages/allegro5.2.4; \
21         make
22
23 nanox:
24         cd $(WORKDIR)/packages/nanox; \
25         make
26
27 fltk:
28         cd $(WORKDIR)/packages/fltk1.3.4; \
29         make
30
31 tinyxml:
32         cd $(WORKDIR)/packages/tinyxml2; \
33         make
34
35 libsndfile:
36         cd $(WORKDIR)/packages/libsndfile1.0.28; \
37         make
38
39 libao:
40         cd $(WORKDIR)/packages/libao1.2.2; \
41         make
42
43 gtest:
44         cd $(WORKDIR)/packages/googletest1.8.1; \
45         make
46
47 boost:
48         cd $(WORKDIR)/packages/boost1.68.0; \
49         make
50
51 tinyalsa:
52         cd $(WORKDIR)/packages/tinyalsa1.0.2; \
53         make
54
55 alsa:
56         cd $(WORKDIR)/packages/alsa-lib1.1.8; \
57         make
58
59 gl4es:
60         cd $(WORKDIR)/packages/gl4es1.1.0; \
61         make
62
63 #### _template App
64 _template:
65         cd $(WORKDIR)/src; \
66         make
67
68
69 #### Clean
70 clean_freetype:
71         cd $(WORKDIR)/packages/freetype2.9.1; \
72         make clean
73
74 clean_allegro:
75         cd $(WORKDIR)/packages/allegro5.2.4; \
76         make clean
77
78 clean_nanox:
79         cd $(WORKDIR)/packages/nanox; \
80         make clean
81
82 clean_fltk:
83         cd $(WORKDIR)/packages/fltk1.3.4; \
84         make clean
85
86 clean_tinyxml:
87         cd $(WORKDIR)/packages/tinyxml2; \
88         make clean
89
90 clean_libsndfile:
91         cd $(WORKDIR)/packages/libsndfile1.0.28; \
92         make clean
93
94 clean_libao:
95         cd $(WORKDIR)/packages/libao1.2.2; \
96         make clean
97
98 clean_gtest:
99         cd $(WORKDIR)/packages/googletest1.8.1; \
100         make clean
101
102 clean_boost:
103         cd $(WORKDIR)/packages/boost1.68.0; \
104         make clean
105
106 clean_tinyalsa:
107         cd $(WORKDIR)/packages/tinyalsa1.0.2; \
108         make clean
109
110 clean_alsa:
111         cd $(WORKDIR)/packages/alsa-lib1.1.8; \
112         make clean
113
114 clean_gl4es:
115         cd $(WORKDIR)/packages/gl4es1.1.0; \
116         make clean
117
118 clean__template:
119         cd $(WORKDIR)/src; \
120         make clean
121
122 clean_lib:
123         rm -rf $(WORKDIR)/lib/
124         rm -rf $(WORKDIR)/tools/
125         rm -rf $(WORKDIR)/lib_include/
126
127 ### Create packages
128 linux32_package:
129         mkdir -p $(WORKDIR)/install_package/linux32/lib
130         mkdir -p $(WORKDIR)/install_package/linux32/bin
131         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/lib
132         cp $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/bin
133         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/linux32/
134         cp $(APPINFO)/start__template $(WORKDIR)/install_package/linux32/
135         cp $(APPINFO)/start__template.desktop $(WORKDIR)/install_package/linux32/
136         cp $(APPINFO)/Icon.png $(WORKDIR)/install_package/linux32/
137         tar -zcvf $(WORKDIR)/install_package/install__template_linux32 -C $(WORKDIR)/install_package/linux32/ .
138         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install__template_linux32
139         rm $(WORKDIR)/install_package/install__template_linux32 
140
141 linux_arm_package:
142         mkdir -p $(WORKDIR)/install_package/linux_arm/lib
143         mkdir -p $(WORKDIR)/install_package/linux_arm/bin
144         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/lib
145         cp $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/bin
146         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/linux_arm/
147         cp $(APPINFO)/start__template $(WORKDIR)/install_package/linux_arm/
148         cp $(APPINFO)/start__template.desktop $(WORKDIR)/install_package/linux_arm/
149         cp $(APPINFO)/Icon.png $(WORKDIR)/install_package/linux_arm/
150         tar -zcvf $(WORKDIR)/install_package/install__template_linux_arm -C $(WORKDIR)/install_package/linux_arm/ .
151         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install__template_linux_arm
152         rm $(WORKDIR)/install_package/install__template_linux_arm 
153
154 windows_package:
155         mkdir -p $(WORKDIR)/install_package/windows/
156         cp $(WORKDIR)/src/bin/Release_Windows/_template.exe $(WORKDIR)/install_package/windows/
157         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/windows/
158         cd $(WORKDIR)/scripts/; \
159         ./gen_package_windows.sh $(WORKDIR)/install_package/windows/*; \
160         mv ./*.exe $(WORKDIR)/install_package/install__template_windows.exe
161
162 android_package:
163         mkdir -p $(WORKDIR)/install_package/
164         cp $(WORKDIR)/src/bin/Android/_template.apk $(WORKDIR)/install_package/install__template_android.apk
165
166 clean: clean_lib clean__template clean_fltk  clean_tinyxml clean_allegro clean_nanox clean_freetype clean_libsndfile clean_libao clean_boost clean_gtest clean_tinyalsa clean_gl4es