X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=Makefile;h=c09177295048fbe37256179e1b7783aaf3736634;hb=1dc27317afdead5c974e737f982606d3bde5de47;hp=05599e9bda359e3450119907d10b26878d6eff2b;hpb=54dac9ba2254fc8378d07290f176f90a60746c42;p=fw%2Fsdcc diff --git a/Makefile b/Makefile index 05599e9b..c0917729 100644 --- a/Makefile +++ b/Makefile @@ -3,20 +3,48 @@ # SHELL = /bin/sh -AUTOCONF = autoconf PRJDIR = . -SDCC_MISC = debugger/mcs51 sim/ucsim binutils-2.9.5.0.13 -SDCC_LIBS = support/cpp -SDCC_ASLINK = as/mcs51 as link -PKGS = $(SDCC_MISC) $(SDCC_LIBS) $(SDCC_ASLINK) \ - src device/include device/lib -PKGS_TINI = $(SDCC_LIBS) $(SDCC_ASLINK) \ - src device/include -PORTS = mcs51 z80 +include $(PRJDIR)/Makefile.common + +SDCC_MISC = debugger/mcs51 sim/ucsim +SDCC_LIBS = support/cpp2 support/makebin +SDCC_DOC = doc + +# Parts that are not normally compiled but need to be cleaned +SDCC_EXTRA = support/regression + +SDCC_ASLINK = as/mcs51 as link as/hc08 +SDCC_PACKIHX = packihx +SDCC_LIBRARIAN = support/librarian + +TARGETS = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc + +PKGS = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC) + +ifneq ($(OPT_ENABLE_UCSIM), no) +TARGETS += sdcc-misc +PKGS += $(SDCC_MISC) +endif + +ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no) +TARGETS += sdcc-device +PKGS += device/include device/lib +endif + +ifneq ($(OPT_ENABLE_PACKIHX), no) +TARGETS += sdcc-packihx +PKGS += $(SDCC_PACKIHX) +endif + +TARGETS += sdcc-librarian +PKGS += $(SDCC_LIBRARIAN) -srcdir = . +PKGS_TINI = $(SDCC_LIBS) $(SDCC_ASLINK) \ + src device/include $(SDCC_PACKIHX) $(SDCC_LIBRARIAN) +PORTS = $(shell cat ports.build) +ALLPORTS = $(shell cat ports.all) # Compiling entire program or any subproject # ------------------------------------------ @@ -25,11 +53,6 @@ all: checkconf sdcc tini: checkconf sdcc-tini sdcc-libs: -ifeq ($(CROSS_LIBGC),1) - $(MAKE) -C support/gc -f Makefile.cross -else - $(MAKE) -C support/gc -endif for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done sdcc-cc: sdcc-libs @@ -41,7 +64,13 @@ sdcc-aslink: sdcc-misc: for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done -sdcc-device: +sdcc-packihx: + $(MAKE) -C $(SDCC_PACKIHX) + +sdcc-librarian: + $(MAKE) -C $(SDCC_LIBRARIAN) + +sdcc-device: sdcc-cc sdcc-aslink $(MAKE) -C device/include $(MAKE) -C device/lib @@ -49,10 +78,12 @@ sdcc-device-tini: $(MAKE) -C device/include $(MAKE) -C device/lib modelDS390 -sdcc: sdcc-cc sdcc-aslink sdcc-misc sdcc-device - $(MAKE) -f main.mk all +# Empty for now, as doc depends on latex and latex2html +sdcc-doc: + +sdcc: $(TARGETS) -sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini +sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx sdcc-librarian $(MAKE) -f main.mk all # Some interesting sub rules @@ -93,10 +124,9 @@ clean: $(MAKE) -f clean.mk clean @echo "+ Cleaning packages in their directories..." for pkg in $(PKGS); do\ - $(MAKE) PORTS="$(PORTS)" -C $$pkg clean ;\ + $(MAKE) PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -C $$pkg -f clean.mk clean ;\ done - # Deleting all files created by configuring or building the program # ----------------------------------------------------------------- distclean: @@ -104,16 +134,18 @@ distclean: $(MAKE) -f clean.mk distclean @echo "+ DistCleaning packages using clean.mk..." for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" distclean ;\ + $(MAKE) -C $$pkg PORTS="$(PORTS)" EXEEXT=$(EXEEXT) -f clean.mk distclean ;\ + done + for pkg in $(SDCC_EXTRA); do \ + $(MAKE) -C $$pkg clean; \ done - # Like clean but some files may still exist # ----------------------------------------- mostlyclean: clean $(MAKE) -f clean.mk mostlyclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" mostlyclean ;\ + $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) mostlyclean ;\ done @@ -123,7 +155,7 @@ mostlyclean: clean realclean: distclean $(MAKE) -f clean.mk realclean for pkg in $(PKGS); do\ - $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" realclean ;\ + $(MAKE) -C $$pkg -f clean.mk PORTS="$(PORTS)" EXEEXT=$(EXEEXT) realclean ;\ done