12 include $(srcdir)/Makefile.common
14 SDCC_MISC = debugger/mcs51 sim/ucsim
15 SDCC_LIBS = support/cpp support/cpp2
18 SDCC_ASLINK = as/mcs51 as link
19 SDCC_PACKIHX = packihx
21 TARGETS = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc
23 PKGS = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC)
25 ifneq ($(OPT_ENABLE_UCSIM), no)
30 ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no)
31 TARGETS += sdcc-device
32 PKGS += device/include device/lib
35 ifneq ($(OPT_ENABLE_PACKIHX), no)
36 TARGETS += sdcc-packihx
37 PKGS += $(SDCC_PACKIHX)
40 PKGS_TINI = $(SDCC_LIBS) $(SDCC_ASLINK) \
41 src device/include $(SDCC_PACKIHX)
42 PORTS = $(shell cat ports.build)
43 ALLPORTS = $(shell cat ports.all)
45 # Compiling entire program or any subproject
46 # ------------------------------------------
49 tini: checkconf sdcc-tini
52 for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
58 for as in $(SDCC_ASLINK); do $(MAKE) -C $$as; done
61 for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done
64 $(MAKE) -C $(SDCC_PACKIHX)
67 $(MAKE) -C device/include
71 $(MAKE) -C device/include
72 $(MAKE) -C device/lib modelDS390
74 # Empty for now, as doc depends on latex and latex2html
79 sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx
80 $(MAKE) -f main.mk all
82 # Some interesting sub rules
83 sdcc-bin: sdcc-cc sdcc-aslink sdcc-misc
85 sdcc-base: sdcc-cc sdcc-aslink
87 # Compiling and installing everything and runing test
88 # ---------------------------------------------------
90 $(MAKE) -f main.mk install
91 @for pkg in $(PKGS); do\
92 $(MAKE) -C $$pkg install ;\
96 $(MAKE) -f main.mk install
97 @for pkg in $(PKGS_TINI); do\
98 $(MAKE) -C $$pkg install ;\
100 $(MAKE) -C device/lib installDS390
104 # Deleting all the installed files
105 # --------------------------------
107 $(MAKE) -f main.mk uninstall
108 @for pkg in $(PKGS); do\
109 $(MAKE) -C $$pkg uninstall ;\
113 # Deleting all files created by building the program
114 # --------------------------------------------------
116 @echo "+ Cleaning root of the project..."
117 $(MAKE) -f clean.mk clean
118 @echo "+ Cleaning packages in their directories..."
119 for pkg in $(PKGS); do\
120 $(MAKE) PORTS="$(PORTS)" -C $$pkg clean ;\
124 # Deleting all files created by configuring or building the program
125 # -----------------------------------------------------------------
127 @echo "+ DistCleaning root of the project..."
128 $(MAKE) -f clean.mk distclean
129 @echo "+ DistCleaning packages using clean.mk..."
130 for pkg in $(PKGS); do\
131 $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" distclean ;\
135 # Like clean but some files may still exist
136 # -----------------------------------------
138 $(MAKE) -f clean.mk mostlyclean
139 for pkg in $(PKGS); do\
140 $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" mostlyclean ;\
144 # Deleting everything that can reconstructed by this Makefile. It deletes
145 # everything deleted by distclean plus files created by bison, stc.
146 # -----------------------------------------------------------------------
148 $(MAKE) -f clean.mk realclean
149 for pkg in $(PKGS); do\
150 $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" realclean ;\
154 # Creating distribution
155 # ---------------------
157 @if [ -f devel ]; then\
158 rm -f devel; mkdist sdcc; touch devel;\
164 # Performing self-test
165 # --------------------
169 # Performing installation test
170 # ----------------------------
174 # Creating dependencies
175 # ---------------------
177 $(MAKE) -f main.mk dep
178 @for pkg in $(PKGS); do\
179 $(MAKE) -C $$pkg dep ;\
186 @if [ -f start ]; then \
188 `find . -newer start -type f -print` |\
189 gzip -9c >`date '+%m%d%H%M'`.tgz; \
191 echo "start file not found.\n"; \
196 'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
199 # Remaking configuration
200 # ----------------------
201 configure: configure.in
204 main.mk: $(srcdir)/main_in.mk $(srcdir)/configure.in config.status
205 $(SHELL) ./config.status
209 makefiles: config.status
211 config.status: configure
212 $(SHELL) ./config.status --recheck
215 $(SHELL) ./config.status
220 @if [ -f devel ]; then\