Add all
[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
9 all: deps _template create_installers
10 deps: freetype allegro nanox fltk
11 create_installers: linux32_package linux_arm_package windows_package android_package
12
13 #### Dependencies
14 freetype:
15         cd $(WORKDIR)/packages/freetype2; \
16         make
17
18 allegro:
19         cd $(WORKDIR)/packages/allegro5.1.13; \
20         make
21
22 nanox:
23         cd $(WORKDIR)/packages/nanox; \
24         make
25
26 fltk:
27         cd $(WORKDIR)/packages/fltk1.3; \
28         make
29
30 tinyxml:
31         cd $(WORKDIR)/packages/tinyxml; \
32         make
33
34 libsndfile:
35         cd $(WORKDIR)/packages/libsndfile; \
36         make
37
38 libao:
39         cd $(WORKDIR)/packages/libao; \
40         make
41
42 gtest:
43         cd $(WORKDIR)/packages/googletest; \
44         make
45
46 boost:
47         cd $(WORKDIR)/packages/boost; \
48         make
49
50 #### _template App
51 _template:
52         cd $(WORKDIR)/src; \
53         make
54
55
56 #### Clean
57 clean_freetype:
58         cd $(WORKDIR)/packages/freetype2; \
59         make clean
60
61 clean_allegro:
62         cd $(WORKDIR)/packages/allegro5.1.13; \
63         make clean
64
65 clean_nanox:
66         cd $(WORKDIR)/packages/nanox; \
67         make clean
68
69 clean_fltk:
70         cd $(WORKDIR)/packages/fltk1.3; \
71         make clean
72
73 clean_tinyxml:
74         cd $(WORKDIR)/packages/tinyxml; \
75         make clean
76
77 clean_libsndfile:
78         cd $(WORKDIR)/packages/libsndfile; \
79         make clean
80
81 clean_libao:
82         cd $(WORKDIR)/packages/libao; \
83         make clean
84
85 clean_gtest:
86         cd $(WORKDIR)/packages/googletest; \
87         make clean
88
89 clean_boost:
90         cd $(WORKDIR)/packages/boost; \
91         make clean
92
93 clean__template:
94         cd $(WORKDIR)/src; \
95         make clean
96
97 clean_lib:
98         rm -rf $(WORKDIR)/lib/
99         rm -rf $(WORKDIR)/tools/
100         find $(WORKDIR)/include/ ! -name 'json.h' ! -name '.gitignore' -type f -exec rm -f {} +
101         find $(WORKDIR)/include/ -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
102
103 ### Create packages
104 linux32_package:
105         mkdir -p $(WORKDIR)/install_package/linux32/lib
106         mkdir -p $(WORKDIR)/install_package/linux32/bin
107         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/lib
108         cp $(WORKDIR)/src/bin/Release_Linux32/_template $(WORKDIR)/install_package/linux32/bin
109         cp $(WORKDIR)/src/start__template $(WORKDIR)/install_package/linux32/
110         cp $(WORKDIR)/src/start__template.desktop $(WORKDIR)/install_package/linux32/
111         cp $(WORKDIR)/src/Icon.png $(WORKDIR)/install_package/linux32/
112         tar -zcvf $(WORKDIR)/install_package/install_linux32 -C $(WORKDIR)/install_package/linux32/ .
113         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install_linux32
114         rm $(WORKDIR)/install_package/install_linux32 
115
116 linux_arm_package:
117         mkdir -p $(WORKDIR)/install_package/linux_arm/lib
118         mkdir -p $(WORKDIR)/install_package/linux_arm/bin
119         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/lib
120         cp $(WORKDIR)/src/bin/Release_LinuxARM/_template $(WORKDIR)/install_package/linux_arm/bin
121         cp $(WORKDIR)/src/start__template $(WORKDIR)/install_package/linux_arm/
122         cp $(WORKDIR)/src/start__template.desktop $(WORKDIR)/install_package/linux_arm/
123         cp $(WORKDIR)/src/Icon.png $(WORKDIR)/install_package/linux_arm/
124         tar -zcvf $(WORKDIR)/install_package/install_linux_arm -C $(WORKDIR)/install_package/linux_arm/ .
125         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install_linux_arm
126         rm $(WORKDIR)/install_package/install_linux_arm 
127
128 windows_package:
129         mkdir -p $(WORKDIR)/install_package/windows/
130         cp $(WORKDIR)/src/bin/Release_Windows/_template.exe $(WORKDIR)/install_package/windows/
131         cd $(WORKDIR)/scripts/; \
132         ./gen_package_windows.sh $(WORKDIR)/install_package/windows/*; \
133         mv ./*.exe $(WORKDIR)/install_package/install_windows.exe
134
135 android_package:
136         mkdir -p $(WORKDIR)/install_package/
137         cp $(WORKDIR)/src/bin/Android/_template.apk $(WORKDIR)/install_package/
138
139 clean: clean_lib clean__template clean_fltk  clean_tinyxml clean_allegro clean_nanox clean_freetype clean_libsndfile clean_libao clean_boost clean_gtest