forked from reticulatedpines/magiclantern_simplified
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
150 lines (123 loc) · 3.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#build system for Magic Lantern.
#build and install are working, LUA not tested
#http://www.gnu.org/software/make/manual/make.html#Automatic-Variables
#http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
TOP_DIR=.
include Makefile.setup
############################################################################################################
#
# include platform data to build "top level" rules for every model
#
# this allows e.g.
# make 5D3
# make 5D3.113
# make 5D3.123
# make 5D3_install
# make 5D3.113_install
# on this top level Makefile
#
include $(PLATFORM_PATH)/Makefile.platform.map
$(foreach _,$(PLATFORM_MAP),$(eval $(call makerule,$(word 1, $(subst ., ,$_)),$_,$(PLATFORM_PATH)/)))
############################################################################################################
all: modules_all platform_all
install: platform_install
clean: platform_clean doxygen_clean modules_clean
############################
# module rules
############################
modules_all:
$(MAKE) -C modules all
modules_clean:
$(MAKE) -C modules clean
############################
# fir rules
############################
fir_all:
$(MAKE) -C installer clean_and_fir
fir_install: fir
$(MAKE) -C installer install_fir
############################
# platform rules
############################
platform_install:
$(MAKE) -C $(PLATFORM_PATH) install
platform_clean:
$(MAKE) -C $(PLATFORM_PATH) clean
platform_all:
$(MAKE) -C $(PLATFORM_PATH) all
############################
# additional clean rules
############################
clean:
$(call rm_files, \
magiclantern.lds \
tmp.lds \
$(LUA_PATH)/*.o \
$(LUA_PATH)/.*.d \
$(LUA_PATH)/liblua.a \
doc/Cropmarks550D.png \
doc/credits.tex \
doc/install-body.tex \
doc/install.wiki \
doc/menuindex.txt \
src/menuindexentries.h \
doc/userguide.rst \
doc/INSTALL.aux \
doc/INSTALL.log \
doc/INSTALL.out \
doc/INSTALL.pdf \
doc/INSTALL.rst \
doc/INSTALL.tex \
doc/INSTALL.toc \
doc/UserGuide-cam.aux \
doc/UserGuide-cam.log \
doc/UserGuide-cam.out \
doc/UserGuide-cam.pdf \
doc/UserGuide-cam.tex \
doc/UserGuide.aux \
doc/UserGuide.log \
doc/UserGuide.out \
doc/UserGuide.pdf \
doc/UserGuide.tex \
doc/UserGuide.toc \
*.pdf \
)
$(call rm_dir, doc/cam)
$(call rm_dir, $(BINARIES_PATH))
# We must build the docs first to use fresh doc/menuindex.txt
# during 'make all'. We can't write 'zip: all docs' because
# of possible problem in case of parallel build.
# (see make's '-j' option documentation)
#zip: docs
# $(MAKE) all
# cd $(PLATFORM_PATH)/all; $(MAKE) zip
docs:
cd $(PLATFORM_PATH)/all; $(MAKE) docs
docq:
cd $(PLATFORM_PATH)/all; $(MAKE) docq
doxygen:
doxygen
doxygen_clean:
$(call rm_dir, doxygen-doc)
features.html: FORCE
cd features; python2 features-html.py > ../features.html
# static analysis: annotate each function with its caller tasks
# requires a custom build that will generate some invalid code (fixme)
# that's why "make clean" commands are used before AND after the analysis
tasks:
python -m doctest build_tools/check_tasks.py
make -C platform/5D3.113/ clean
make -C platform/5D3.113/ PREPRO=y PYCPARSER=y
make -i -C modules/ clean
make -i -C modules/ PREPRO=y PYCPARSER=y
make -i -C modules/lua clean
cd platform/5D3.113; python ../../build_tools/check_tasks.py *.i ../../modules/*/*.i
make -i -C modules/ clean
make -C platform/5D3.113 clean
tasks-clang:
clang -fsyntax-only -Wthread-safety src/mutex-test.c
FORCE:
# we want ML platforms to be built sequentially, to avoid conflicts
# => use .NOTPARALLEL in the upper-level Makefiles only
# parallel build is still used within each platform
.NOTPARALLEL: