struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / Makefile.in
blob8901a8dc0a4a62c89e877a82127a7dbcd6215d5d
2 # sdcc project main Makefile
5 SHELL = /bin/sh
7 VPATH = @srcdir@
8 srcdir = @srcdir@
9 top_builddir = @top_builddir@
10 top_srcdir = @top_srcdir@
12 EXEEXT = @EXEEXT@
14 include Makefile.common
16 SDCC_LIBS = support/makebin
17 SDCC_SCRIPTS = support/scripts
18 SDCC_DOC = doc
20 # Parts that are not normally compiled but need to be cleaned
21 SDCC_EXTRA = support/regression support/valdiag
23 SDCC_PACKIHX = support/packihx
24 SDCC_SDBINUTILS = support/sdbinutils
26 ifneq ($(OPT_DISABLE_HC08)$(OPT_DISABLE_S08), 11)
27 SDCC_AS += sdas/as6808
28 SDCC_LD += sdcc-ld6808
29 endif
31 ifneq ($(OPT_DISABLE_MOS6502)$(OPT_DISABLE_MOS65C02), 11)
32 SDCC_AS += sdas/as6500
33 SDCC_LD += sdcc-ld6808
34 endif
36 ifeq ($(OPT_DISABLE_STM8), 0)
37 SDCC_AS += sdas/asstm8
38 SDCC_LD += sdcc-ldstm8
39 endif
41 ifneq ($(OPT_DISABLE_DS390)$(OPT_DISABLE_DS400), 11)
42 SDCC_AS += sdas/as8xcxxx
43 endif
45 ifeq ($(OPT_DISABLE_MCS51), 0)
46 SDCC_AS += sdas/as8051
47 SDCC_LD += sdcc-ld8051
48 SDCC_MISC += debugger/mcs51
49 endif
51 ifneq ($(OPT_DISABLE_Z80)$(OPT_DISABLE_Z180)$(OPT_DISABLE_Z80N)$(OPT_DISABLE_R800), 1111)
52 SDCC_AS += sdas/asz80
53 SDCC_LD += sdcc-ldz80
54 endif
56 ifneq ($(OPT_DISABLE_R2K)$(OPT_DISABLE_R2KA)$(OPT_DISABLE_R3KA), 111)
57 SDCC_AS += sdas/asrab
58 SDCC_LD += sdcc-ldz80
59 endif
61 ifeq ($(OPT_DISABLE_TLCS90), 0)
62 SDCC_AS += sdas/astlcs90
63 endif
65 ifeq ($(OPT_DISABLE_SM83), 0)
66 SDCC_AS += sdas/asgb
67 SDCC_LD += sdcc-ldgb
68 endif
70 ifeq ($(OPT_DISABLE_PDK13), 0)
71 SDCC_AS += sdas/aspdk13
72 SDCC_LD += sdcc-ldpdk
73 endif
75 ifeq ($(OPT_DISABLE_PDK14), 0)
76 SDCC_AS += sdas/aspdk14
77 SDCC_LD += sdcc-ldpdk
78 endif
80 ifeq ($(OPT_DISABLE_PDK15), 0)
81 SDCC_AS += sdas/aspdk15
82 SDCC_LD += sdcc-ldpdk
83 endif
85 ifeq ($(OPT_DISABLE_PDK16), 0)
86 SDCC_AS += sdas/aspdk16
87 SDCC_LD += sdcc-ldpdk
88 endif
90 ifeq ($(OPT_DISABLE_F8), 0)
91 SDCC_AS += sdas/asf8
92 SDCC_LD += sdcc-ldf8
93 endif
96 ifeq ($(OPT_DISABLE_UCSIM), 0)
97 TARGETS += sdcc-misc
98 SDCC_MISC += sim/ucsim
99 PKGS += $(SDCC_MISC)
100 endif
102 SDCC_BINUTILS =
103 ifeq ($(OPT_DISABLE_SDBINUTILS), 0)
104 TARGETS += sdcc-sdbinutils
105 PKGS += $(SDCC_SDBINUTILS)
106 SDCC_BINUTILS = sdcc-sdbinutils
107 endif
109 ifeq ($(OPT_DISABLE_DEVICE_LIB), 0)
110 TARGETS += sdcc-device-lib
111 PKGS += device/lib
112 ifeq ($(OPT_DISABLE_NON_FREE), 0)
113 PKGS += device/non-free/lib
114 endif
115 endif
117 ifeq ($(OPT_DISABLE_PACKIHX), 0)
118 TARGETS += sdcc-packihx
119 PKGS += $(SDCC_PACKIHX)
120 endif
122 ifeq ($(OPT_ENABLE_DOC), 1)
123 TARGETS += sdcc-doc
124 endif
125 # always install docs, which don't need to be built
126 PKGS += $(SDCC_DOC)
128 ifeq ($(OPT_DISABLE_SDCPP), 0)
129 SDCC_LIBS += support/cpp
130 endif
132 TARGETS += sdcc-libs sdcc-cc sdcc-device-inc sdcc-as sdcc-ld sdcc-scripts
134 PKGS += $(SDCC_LIBS) src device/include
135 ifeq ($(OPT_DISABLE_NON_FREE), 0)
136 PKGS += device/non-free/include
137 endif
138 PKGS += $(SDCC_AS) sdas/linksrc $(SDCC_SCRIPTS)
140 PORTS = $(shell cat ports.build)
141 ALLPORTS = $(shell cat ports.all)
143 # Compiling entire program or any subproject
144 # ------------------------------------------
145 all: checkconf sdcc
147 tini: checkconf sdcc-tini
149 sdcc-libs: ${SDCC_BINUTILS}
150 for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
152 sdcc-cc: sdcc-libs
153 $(MAKE) -C src
155 sdcc-as:
156 $(foreach as, $(SDCC_AS), $(MAKE) -C $(as) &&) echo "Assemblers built successfully."
158 sdcc-ld:
159 $(MAKE) -C sdas/linksrc $(SDCC_LD)
161 sdcc-misc:
162 for misc in $(SDCC_MISC); do $(MAKE) -C $$misc ; done
164 sdcc-scripts:
165 $(MAKE) -C $(SDCC_SCRIPTS)
167 sdcc-packihx:
168 $(MAKE) -C $(SDCC_PACKIHX)
170 sdcc-sdbinutils:
171 $(MAKE) -C $(SDCC_SDBINUTILS)
173 sdcc-device-inc:
174 $(MAKE) -C device/include
175 ifeq ($(OPT_DISABLE_NON_FREE), 0)
176 $(MAKE) -C device/non-free/include
177 endif
179 sdcc-device-lib: sdcc-cc sdcc-as sdcc-ld $(SDCC_BINUTILS)
180 $(MAKE) -C device/lib
181 ifeq ($(OPT_DISABLE_NON_FREE), 0)
182 $(MAKE) -C device/non-free/lib
183 endif
185 sdcc-device-tini:
186 $(MAKE) -C device/include
187 ifeq ($(OPT_DISABLE_NON_FREE), 0)
188 $(MAKE) -C device/non-free/include
189 endif
190 $(MAKE) -C device/lib model-ds390 model-ds400
192 # doc depends on latex and latex2html
193 sdcc-doc:
194 $(MAKE) -C doc
196 sdcc: $(TARGETS)
198 sdcc-tini: sdcc-cc sdcc-as sdcc-ld sdcc-device-tini sdcc-packihx
199 $(MAKE) -f main.mk all
201 # Some interesting sub rules
202 sdcc-bin: sdcc-cc sdcc-as sdcc-ld sdcc-misc
204 sdcc-base: sdcc-cc sdcc-as sdcc-ld
206 # Compiling and installing everything and running test
207 # ----------------------------------------------------
208 install: checkconf sdcc
209 $(MAKE) -f main.mk install
210 @for pkg in $(PKGS); do\
211 $(MAKE) -C $$pkg install ;\
212 done
214 # Deleting all the installed files
215 # --------------------------------
216 uninstall:
217 $(MAKE) -f main.mk uninstall
218 @for pkg in $(PKGS); do\
219 $(MAKE) -C $$pkg uninstall ;\
220 done
222 # Deleting all files created by building the program
223 # --------------------------------------------------
224 clean:
225 @echo "+ Cleaning root of the project..."
226 $(MAKE) -f $(srcdir)/clean.mk clean
227 @echo "+ Cleaning packages in their directories..."
228 for pkg in $(PKGS); do\
229 $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) clean ;\
230 done
232 # Deleting all files created by configuring or building the program
233 # -----------------------------------------------------------------
234 distclean:
235 @echo "+ DistCleaning packages using clean.mk..."
236 for pkg in $(PKGS); do\
237 $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) distclean ;\
238 done
239 for pkg in $(SDCC_EXTRA); do \
240 $(MAKE) -C $$pkg distclean; \
241 done
242 @echo "+ DistCleaning root of the project..."
243 $(MAKE) -f $(srcdir)/clean.mk distclean
245 # Like clean but some files may still exist
246 # -----------------------------------------
247 mostlyclean: clean
248 $(MAKE) -f $(srcdir)/clean.mk mostlyclean
249 for pkg in $(PKGS); do\
250 $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\
251 done
253 # Deleting everything that can reconstructed by this Makefile. It deletes
254 # everything deleted by distclean plus files created by bison, stc.
255 # -----------------------------------------------------------------------
256 realclean: distclean
257 $(MAKE) -f $(srcdir)/clean.mk realclean
258 for pkg in $(PKGS); do\
259 $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\
260 done
262 # Performing self-test
263 # --------------------
264 check:
266 # Performing installation test
267 # ----------------------------
268 installcheck:
270 # Creating dependencies
271 # ---------------------
272 dep: $(SDCC_LIBS)
273 $(MAKE) -f main.mk dep
274 @for pkg in $(PKGS); do\
275 $(MAKE) -C $$pkg dep ;\
276 done
278 # My rules
279 # --------
280 newer: distclean
281 @if [ -f start ]; then \
282 tar cvf - \
283 `find . -newer start -type f -print` |\
284 gzip -9c >`date '+%m%d%H%M'`.tgz; \
285 else \
286 echo "start file not found.\n"; \
287 exit 1; \
290 putcopyright:
291 'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
293 # Remaking configuration
294 # ----------------------
295 configure: configure.in
296 $(SHELL) $(AUTOCONF)
298 main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
299 $(SHELL) ./config.status
301 Makefiles: makefiles
303 makefiles: config.status
305 config.status: configure
306 $(SHELL) ./config.status --recheck
308 makefiles:
309 $(SHELL) ./config.status
311 freshconf: main.mk
313 checkconf:
314 @if [ -f devel ]; then\
315 $(MAKE) freshconf;\
318 # End of Makefile
320 Makefile: $(srcdir)/Makefile.in
321 cd $(top_builddir); ./config.status Makefile
323 Makefile.common: $(srcdir)/Makefile.common.in
324 cd $(top_builddir); ./config.status Makefile.common