9 SDCC_MISC = debugger/mcs51 sim/ucsim
10 SDCC_LIBS = support/cpp support/cpp2
13 # Parts that are not normally compiled but need to be cleaned
14 SDCC_EXTRA = support/regression support/makebin
16 SDCC_ASLINK = as/mcs51 as link
17 SDCC_PACKIHX = packihx
19 TARGETS = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc
21 PKGS = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC)
23 ifneq ($(OPT_ENABLE_UCSIM), no)
28 ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no)
29 TARGETS += sdcc-device
30 PKGS += device/include device/lib
33 ifneq ($(OPT_ENABLE_PACKIHX), no)
34 TARGETS += sdcc-packihx
35 PKGS += $(SDCC_PACKIHX)
38 PKGS_TINI = $(SDCC_LIBS) $(SDCC_ASLINK) \
39 src device/include $(SDCC_PACKIHX)
40 PORTS = $(shell cat ports.build)
41 ALLPORTS = $(shell cat ports.all)
43 # Compiling entire program or any subproject
44 # ------------------------------------------
47 tini: checkconf sdcc-tini
50 for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
56 for as in $(SDCC_ASLINK); do $(MAKE) -C $$as; done
59 for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done
62 $(MAKE) -C $(SDCC_PACKIHX)
65 $(MAKE) -C device/include
69 $(MAKE) -C device/include
70 $(MAKE) -C device/lib modelDS390
72 # Empty for now, as doc depends on latex and latex2html
77 sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx
78 $(MAKE) -f main.mk all
80 # Some interesting sub rules
81 sdcc-bin: sdcc-cc sdcc-aslink sdcc-misc
83 sdcc-base: sdcc-cc sdcc-aslink
85 # Compiling and installing everything and runing test
86 # ---------------------------------------------------
88 $(MAKE) -f main.mk install
89 @for pkg in $(PKGS); do\
90 $(MAKE) -C $$pkg install ;\
94 $(MAKE) -f main.mk install
95 @for pkg in $(PKGS_TINI); do\
96 $(MAKE) -C $$pkg install ;\
98 $(MAKE) -C device/lib installDS390
102 # Deleting all the installed files
103 # --------------------------------
105 $(MAKE) -f main.mk uninstall
106 @for pkg in $(PKGS); do\
107 $(MAKE) -C $$pkg uninstall ;\
111 # Deleting all files created by building the program
112 # --------------------------------------------------
114 @echo "+ Cleaning root of the project..."
115 $(MAKE) -f clean.mk clean
116 @echo "+ Cleaning packages in their directories..."
117 for pkg in $(PKGS); do\
118 $(MAKE) PORTS="$(PORTS)" -C $$pkg -f clean.mk clean ;\
121 # Deleting all files created by configuring or building the program
122 # -----------------------------------------------------------------
124 @echo "+ DistCleaning root of the project..."
125 $(MAKE) -f clean.mk distclean
126 @echo "+ DistCleaning packages using clean.mk..."
127 for pkg in $(PKGS); do\
128 $(MAKE) -C $$pkg PORTS="$(PORTS)" -f clean.mk distclean ;\
130 for pkg in $(SDCC_EXTRA); do \
131 $(MAKE) -C $$pkg clean; \
134 # Like clean but some files may still exist
135 # -----------------------------------------
137 $(MAKE) -f clean.mk mostlyclean
138 for pkg in $(PKGS); do\
139 $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" mostlyclean ;\
143 # Deleting everything that can reconstructed by this Makefile. It deletes
144 # everything deleted by distclean plus files created by bison, stc.
145 # -----------------------------------------------------------------------
147 $(MAKE) -f clean.mk realclean
148 for pkg in $(PKGS); do\
149 $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" realclean ;\
153 # Creating distribution
154 # ---------------------
156 @if [ -f devel ]; then\
157 rm -f devel; mkdist sdcc; touch devel;\
163 # Performing self-test
164 # --------------------
168 # Performing installation test
169 # ----------------------------
173 # Creating dependencies
174 # ---------------------
176 $(MAKE) -f main.mk dep
177 @for pkg in $(PKGS); do\
178 $(MAKE) -C $$pkg dep ;\
185 @if [ -f start ]; then \
187 `find . -newer start -type f -print` |\
188 gzip -9c >`date '+%m%d%H%M'`.tgz; \
190 echo "start file not found.\n"; \
195 'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
198 # Remaking configuration
199 # ----------------------
200 configure: configure.in
203 main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
204 $(SHELL) ./config.status
208 makefiles: config.status
210 config.status: configure
211 $(SHELL) ./config.status --recheck
214 $(SHELL) ./config.status
219 @if [ -f devel ]; then\