Added freetype2 support.
[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: freetype allegro nanox fltk _template linux_package windows_package android_package
10
11
12 #### Dependencies
13 freetype:
14         cd $(WORKDIR)/packages/freetype2; \
15         make
16
17 allegro:
18         cd $(WORKDIR)/packages/allegro5.1.13; \
19         make
20
21 nanox:
22         cd $(WORKDIR)/packages/nanox; \
23         make
24
25 fltk:
26         cd $(WORKDIR)/packages/fltk1.3; \
27         make
28
29 tinyxml:
30         cd $(WORKDIR)/packages/tinyxml; \
31         make
32
33 #### _template App
34 _template:
35         cd $(WORKDIR)/src; \
36         make
37
38
39 #### Clean
40 clean_freetype:
41         cd $(WORKDIR)/packages/freetype2; \
42         make clean
43
44 clean_allegro:
45         cd $(WORKDIR)/packages/allegro5.1.13; \
46         make clean
47
48 clean_nanox:
49         cd $(WORKDIR)/packages/nanox; \
50         make clean
51
52 clean_fltk:
53         cd $(WORKDIR)/packages/fltk1.3; \
54         make clean
55
56 clean_tinyxml:
57         cd $(WORKDIR)/packages/tinyxml; \
58         make clean
59
60 clean__template:
61         cd $(WORKDIR)/src; \
62         make clean
63
64 clean_lib:
65         rm -rf $(WORKDIR)/lib/
66         rm -rf $(WORKDIR)/tools/
67         find $(WORKDIR)/include/ ! -name 'json.h' ! -name '.gitignore' -type f -exec rm -f {} +
68         find $(WORKDIR)/include/ -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
69
70 ### Create packages
71 linux_package:
72         mkdir -p $(WORKDIR)/install_package/linux/lib
73         mkdir -p $(WORKDIR)/install_package/linux/bin
74         $(WORKDIR)/scripts/copydeps.sh $(WORKDIR)/src/bin/Release_Linux/_template $(WORKDIR)/install_package/linux/lib
75         cp $(WORKDIR)/src/bin/Release_Linux/_template $(WORKDIR)/install_package/linux/bin
76         cp $(WORKDIR)/src/start__template $(WORKDIR)/install_package/linux/
77         cp $(WORKDIR)/src/start__template.desktop $(WORKDIR)/install_package/linux/
78         cp $(WORKDIR)/src/Icon.png $(WORKDIR)/install_package/linux/
79         tar -zcvf $(WORKDIR)/install_package/install_linux -C $(WORKDIR)/install_package/linux/ .
80         $(WORKDIR)/scripts/gen_package_linux.sh $(WORKDIR)/install_package/install_linux
81         rm $(WORKDIR)/install_package/install_linux 
82
83 windows_package:
84         mkdir -p $(WORKDIR)/install_package/windows/
85         cp $(WORKDIR)/src/bin/Release_Windows/_template.exe $(WORKDIR)/install_package/windows/
86         cd $(WORKDIR)/scripts/; \
87         ./gen_package_windows.sh $(WORKDIR)/install_package/windows/*; \
88         mv ./*.exe $(WORKDIR)/install_package/install_windows.exe
89
90 android_package:
91         mkdir -p $(WORKDIR)/install_package/
92         cp $(WORKDIR)/src/bin/Android/_template.apk $(WORKDIR)/install_package/
93
94 clean: clean_lib clean__template clean_fltk  clean_tinyxml clean_allegro clean_nanox clean_freetype