-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile_base.inc
158 lines (137 loc) · 3.57 KB
/
makefile_base.inc
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
151
152
153
154
155
156
157
158
# Base makefile rules
# Define default target (place this first so it is always selected if no target on command line)
.PHONY: default
default: all
MEMISOSIZE="(&_end-&_start)"
# override this on the command line or in buildconf to use PRIMARY.BIN from a different tree
# should be an absolute path
PRIMARY_ROOT=$(topdir)platform
include $(topdir)buildconf.inc
# optional local version of buildconf.inc, not in SVN so it can be used in autobuilds
# and to avoid getting accidentally included in svn diffs
# you may also set your default camera here
-include $(topdir)localbuildconf.inc
include $(topdir)version.inc
-include $(topdir)revision.inc
ifndef OPT_DE_VERSION
VER=CHDK
ifndef OPT_DEFAULT_LANG
OPT_DEFAULT_LANG=english
endif
else
VER=CHDK_DE
ifndef OPT_DEFAULT_LANG
OPT_DEFAULT_LANG=german
endif
endif
# Define some shorthand file & directory locations
bin=$(topdir)bin
chdk=$(topdir)CHDK
core=$(topdir)core
doc=$(topdir)doc
include=$(topdir)include
loader=$(topdir)loader/$(PLATFORM)
lib=$(topdir)lib
larmutil=$(lib)/armutil
lcore=$(lib)/core
lfont=$(lib)/font
llang=$(lib)/lang
llibc=$(lib)/libc
llua=$(lib)/lua
lubasic=$(lib)/ubasic
modules=$(topdir)modules
platform=$(topdir)platform
tools=$(topdir)tools
cam=$(platform)/$(PLATFORM)
camfw=$(cam)/sub/$(PLATFORMSUB)
TARGET_PRIMARY=$(PRIMARY_ROOT)/$(PLATFORM)/sub/$(PLATFORMSUB)/PRIMARY.BIN
PAKWIF=$(tools)/pakwif$(EXE)
PAKFI2=$(tools)/packfi2/fi2enc$(EXE)
ENCODE_DISKBOOT=$(tools)/dancingbits$(EXE)
# Load camera settings (optional)
ifdef PLATFORM
-include $(cam)/makefile.inc
ifndef THUMB_FW
ifeq ($(DIGIC),$(filter $(DIGIC),60 70))
THUMB_FW=1
endif
endif
# update build rules for Digic 7 ARM changes
ifndef ARMV7A
ifeq ($(DIGIC),$(filter $(DIGIC),70))
ARMV7A=1
endif
endif
endif
# Sub-directory for object and dump files
# used by modules and libraries build
ifndef THUMB_FW
O=.o/
else
ifndef ARMV7A
ifdef CAM_DRAW_YUV
O=.o2/
else
O=.o4/
endif
else
ifdef CAM_DRAW_YUV
O=.o3/
else
O=.o5/
endif
endif
endif
SILENT=SILENT
##########################################################################
include $(topdir)makefile_env.inc
##########################################################################
.PHONY: all
all: all-recursive
.PHONY: clean
clean: clean-recursive
.PHONY: distclean
distclean: distclean-recursive
.dep:
mkdir .dep
clean-recursive:
@for i in $(SUBDIRS); do \
echo \>\> Cleaning in $(FOLDER)$$i; \
$(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" clean || exit 1; \
done
distclean-recursive:
@for i in $(SUBDIRS); do \
echo \>\> Distcleaning in $(FOLDER)$$i; \
$(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" distclean || exit 1; \
done
all-recursive:
@for i in $(SUBDIRS); do \
echo \>\> Entering to $(FOLDER)$$i; \
$(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" || exit 1; \
echo \<\< Leaving $(FOLDER)$$i; \
done
depend-recursive:
@for i in $(SUBDIRS); do \
echo \>\> Entering to $(FOLDER)$$i; \
$(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" depend || exit 1; \
echo \<\< Leaving $(FOLDER)$$i; \
done
ifdef SILENT
.SILENT:
endif
# Define empty recipes for source files (including the makefiles)
# to prevent make from trying implicit rules to create them. Speeds up build process
Makefile: ;
makefile: ;
$(topdir)makefile_base.inc: ;
$(topdir)buildconf.inc: ;
$(topdir)localbuildconf.inc: ;
$(topdir)version.inc: ;
$(topdir)revision.inc: ;
$(cam)/makefile.inc: ;
*.c: ;
*.txt: ;
*.sh: ;
reversebytes.S: ;
callfunc.S: ;
setjmp.S: ;