]> git.gag.com Git - fw/sdcc/blob - Makefile.in
* device/include/pic16/pic18f4550.h,
[fw/sdcc] / Makefile.in
1 #
2 #
3 #
4
5 SHELL           = /bin/sh
6
7 VPATH           = @srcdir@
8 srcdir          = @srcdir@
9 top_builddir    = @top_builddir@
10 top_srcdir      = @top_srcdir@
11
12 include Makefile.common
13
14 SDCC_LIBS       = support/makebin
15 SDCC_DOC        = doc
16
17 # Parts that are not normally compiled but need to be cleaned
18 SDCC_EXTRA      = support/regression
19
20 SDCC_PACKIHX    = support/packihx
21 SDCC_LIBRARIAN  = support/librarian
22
23 ifeq ($(OPT_DISABLE_HC08), 0)
24 SDCC_ASLINK     += as/hc08 as/link/hc08
25 endif
26
27 ifeq ($(OPT_DISABLE_MCS51), 0)
28 SDCC_ASLINK     += as/mcs51 as/link/mcs51
29 SDCC_MISC       += debugger/mcs51
30 endif
31
32 ifeq ($(OPT_DISABLE_Z80), 0)
33 SDCC_ASLINK     += as as/link
34 endif
35
36 ifeq ($(OPT_DISABLE_UCSIM), 0)
37 TARGETS         += sdcc-misc
38 SDCC_MISC       += sim/ucsim
39 PKGS            += $(SDCC_MISC)
40 endif
41
42 ifeq ($(OPT_DISABLE_DEVICE_LIB), 0)
43 TARGETS         += sdcc-device-lib
44 PKGS            += device/lib
45 endif
46
47 ifeq ($(OPT_DISABLE_PACKIHX), 0)
48 TARGETS         += sdcc-packihx
49 PKGS            += $(SDCC_PACKIHX)
50 endif
51
52 ifeq ($(OPT_ENABLE_DOC), 1)
53 TARGETS         += sdcc-doc
54 endif
55 # always install docs, which don't need to be built 
56 PKGS            += $(SDCC_DOC)
57
58 ifeq ($(OPT_DISABLE_SDCPP), 0)
59 SDCC_LIBS       += support/cpp2
60 endif
61
62 TARGETS         += sdcc-libs sdcc-cc sdcc-device-inc sdcc-aslink sdcc-librarian
63
64 PKGS            += $(SDCC_LIBS) src device/include $(SDCC_ASLINK) $(SDCC_LIBRARIAN)
65
66 PKGS_TINI       = $(SDCC_LIBS) $(SDCC_ASLINK) \
67                   src device/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN)
68 PORTS           = $(shell cat ports.build)
69 ALLPORTS        = $(shell cat ports.all)
70
71 # Compiling entire program or any subproject
72 # ------------------------------------------
73 all: checkconf sdcc
74
75 tini: checkconf sdcc-tini
76
77 sdcc-libs:
78         for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
79
80 sdcc-cc: sdcc-libs
81         $(MAKE) -C src
82
83 sdcc-aslink:
84         for as in $(SDCC_ASLINK); do $(MAKE) -C $$as ; done
85
86 sdcc-misc:
87         for misc in $(SDCC_MISC); do $(MAKE) -C $$misc ; done
88
89 sdcc-packihx:
90         $(MAKE) -C $(SDCC_PACKIHX)
91
92 sdcc-librarian:
93         $(MAKE) -C $(SDCC_LIBRARIAN)
94
95 sdcc-device-inc:
96         $(MAKE) -C device/include
97
98 sdcc-device-lib: sdcc-cc sdcc-aslink
99         $(MAKE) -C device/lib
100
101 sdcc-device-tini:
102         $(MAKE) -C device/include
103         $(MAKE) -C device/lib modelDS390
104
105 # doc depends on latex and latex2html
106 sdcc-doc:
107         $(MAKE) -C doc
108
109 sdcc: $(TARGETS)
110
111 sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx sdcc-librarian
112         $(MAKE) -f main.mk all
113
114 # Some interesting sub rules
115 sdcc-bin: sdcc-cc sdcc-aslink sdcc-misc
116
117 sdcc-base: sdcc-cc sdcc-aslink
118
119 # Compiling and installing everything and runing test
120 # ---------------------------------------------------
121 install:
122         $(MAKE) -f main.mk install
123         @for pkg in $(PKGS); do\
124           $(MAKE) -C $$pkg install ;\
125         done
126
127 install-tini:
128         $(MAKE) -f main.mk install
129         @for pkg in $(PKGS_TINI); do\
130           $(MAKE) -C $$pkg install ;\
131         done
132         $(MAKE) -C device/lib installDS390
133
134
135
136 # Deleting all the installed files
137 # --------------------------------
138 uninstall:
139         $(MAKE) -f main.mk uninstall
140         @for pkg in $(PKGS); do\
141           $(MAKE) -C $$pkg uninstall ;\
142         done
143
144
145 # Deleting all files created by building the program
146 # --------------------------------------------------
147 clean:
148         @echo "+ Cleaning root of the project..."
149         $(MAKE) -f $(srcdir)/clean.mk clean
150         @echo "+ Cleaning packages in their directories..."
151         for pkg in $(PKGS); do\
152           $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) clean ;\
153         done
154
155 # Deleting all files created by configuring or building the program
156 # -----------------------------------------------------------------
157 distclean:
158         @echo "+ DistCleaning packages using clean.mk..."
159         for pkg in $(PKGS); do\
160           $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) distclean ;\
161         done
162         for pkg in $(SDCC_EXTRA); do \
163           $(MAKE) -C $$pkg distclean; \
164         done
165         @echo "+ DistCleaning root of the project..."
166         $(MAKE) -f $(srcdir)/clean.mk distclean
167
168 # Like clean but some files may still exist
169 # -----------------------------------------
170 mostlyclean: clean
171         $(MAKE) -f $(srcdir)/clean.mk mostlyclean
172         for pkg in $(PKGS); do\
173           $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\
174         done
175
176
177 # Deleting everything that can reconstructed by this Makefile. It deletes
178 # everything deleted by distclean plus files created by bison, stc.
179 # -----------------------------------------------------------------------
180 realclean: distclean
181         $(MAKE) -f $(srcdir)/clean.mk realclean
182         for pkg in $(PKGS); do\
183           $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\
184         done
185
186
187 # Creating distribution
188 # ---------------------
189 dist: distclean
190         @if [ -f devel ]; then\
191           rm -f devel; mkdist sdcc; touch devel;\
192         else\
193           mkdist sdcc;\
194         fi
195
196
197 # Performing self-test
198 # --------------------
199 check:
200
201
202 # Performing installation test
203 # ----------------------------
204 installcheck:
205
206
207 # Creating dependencies
208 # ---------------------
209 dep:
210         $(MAKE) -f main.mk dep
211         @for pkg in $(PKGS); do\
212           $(MAKE) -C $$pkg dep ;\
213         done
214
215
216 # My rules
217 # --------
218 newer: distclean
219         @if [ -f start ]; then \
220           tar cvf - \
221             `find . -newer start -type f -print` |\
222           gzip -9c >`date '+%m%d%H%M'`.tgz; \
223         else \
224           echo "start file not found.\n"; \
225           exit 1; \
226         fi
227
228 putcopyright:
229         'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
230
231
232 # Remaking configuration
233 # ----------------------
234 configure: configure.in
235         $(SHELL) $(AUTOCONF)
236
237 main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
238         $(SHELL) ./config.status
239
240 Makefiles: makefiles
241
242 makefiles: config.status
243
244 config.status: configure
245         $(SHELL) ./config.status --recheck
246
247 makefiles:
248         $(SHELL) ./config.status
249
250 freshconf: main.mk
251
252 checkconf:
253         @if [ -f devel ]; then\
254           $(MAKE) freshconf;\
255         fi
256
257 # End of Makefile