b37f8e80a57f9530366723c1f47cdfe98dd2e73f
[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.1.13; \
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 #### _template App
60 _template:
61         cd $(WORKDIR)/src; \
62         make
63
64
65 #### Clean
66 clean_freetype:
67         cd $(WORKDIR)/packages/freetype2.9.1; \
68         make clean
69
70 clean_allegro:
71         cd $(WORKDIR)/packages/allegro5.1.13; \
72         make clean
73
74 clean_nanox:
75         cd $(WORKDIR)/packages/nanox; \
76         make clean
77
78 clean_fltk:
79         cd $(WORKDIR)/packages/fltk1.3.4; \
80         make clean
81
82 clean_tinyxml:
83         cd $(WORKDIR)/packages/tinyxml2; \
84         make clean
85
86 clean_libsndfile:
87         cd $(WORKDIR)/packages/libsndfile1.0.28; \
88         make clean
89
90 clean_libao:
91         cd $(WORKDIR)/packages/libao1.2.2; \
92         make clean
93
94 clean_gtest:
95         cd $(WORKDIR)/packages/googletest1.8.1; \
96         make clean
97
98 clean_boost:
99         cd $(WORKDIR)/packages/boost1.68.0; \
100         make clean
101
102 clean_tinyalsa:
103         cd $(WORKDIR)/packages/tinyalsa1.0.2; \
104         make clean
105
106 clean_alsa:
107         cd $(WORKDIR)/packages/alsa-lib1.1.8; \
108         make clean
109
110 clean__template:
111         cd $(WORKDIR)/src; \
112         make clean
113
114 clean_lib:
115         rm -rf $(WORKDIR)/lib/
116         rm -rf $(WORKDIR)/tools/
117         rm -rf $(WORKDIR)/lib_include/
118
119 ### Create packages
120 linux32_package:
121         mkdir -p $(WORKDIR)/install_package/linux32/lib
122         mkdir -p $(WORKDIR)/install_package/linux32/bin
123         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/lib
124         cp $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/bin
125         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/linux32/
126         cp $(APPINFO)/start__template $(WORKDIR)/install_package/linux32/
127         cp $(APPINFO)/start__template.desktop $(WORKDIR)/install_package/linux32/
128         cp $(APPINFO)/Icon.png $(WORKDIR)/install_package/linux32/
129         tar -zcvf $(WORKDIR)/install_package/install__template_linux32 -C $(WORKDIR)/install_package/linux32/ .
130         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install__template_linux32
131         rm $(WORKDIR)/install_package/install__template_linux32 
132
133 linux_arm_package:
134         mkdir -p $(WORKDIR)/install_package/linux_arm/lib
135         mkdir -p $(WORKDIR)/install_package/linux_arm/bin
136         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/lib
137         cp $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/bin
138         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/linux_arm/
139         cp $(APPINFO)/start__template $(WORKDIR)/install_package/linux_arm/
140         cp $(APPINFO)/start__template.desktop $(WORKDIR)/install_package/linux_arm/
141         cp $(APPINFO)/Icon.png $(WORKDIR)/install_package/linux_arm/
142         tar -zcvf $(WORKDIR)/install_package/install__template_linux_arm -C $(WORKDIR)/install_package/linux_arm/ .
143         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install__template_linux_arm
144         rm $(WORKDIR)/install_package/install__template_linux_arm 
145
146 windows_package:
147         mkdir -p $(WORKDIR)/install_package/windows/
148         cp $(WORKDIR)/src/bin/Release_Windows/_template.exe $(WORKDIR)/install_package/windows/
149         cp -r $(WORKDIR)/src/assets/* $(WORKDIR)/install_package/windows/
150         cd $(WORKDIR)/scripts/; \
151         ./gen_package_windows.sh $(WORKDIR)/install_package/windows/*; \
152         mv ./*.exe $(WORKDIR)/install_package/install__template_windows.exe
153
154 android_package:
155         mkdir -p $(WORKDIR)/install_package/
156         cp $(WORKDIR)/src/bin/Android/_template.apk $(WORKDIR)/install_package/install__template_android.apk
157
158 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