Added bug cases. Added decent support for distclean
[fw/sdcc] / Makefile
index 003dd0c6a561f67c57b154f383449c9dc4e443ff..c1a785f92a5600a87068a1410f44f32e26a8dd09 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,25 +2,23 @@
 #
 #
 
-CFLAGS+=-g
-
 SHELL          = /bin/sh
-AUTOCONF       = autoconf
 
 PRJDIR         = .
-srcdir          = .
-include $(srcdir)/Makefile.common
 
 SDCC_MISC      = debugger/mcs51 sim/ucsim
-
 SDCC_LIBS      = support/cpp support/cpp2
+SDCC_DOC        = doc
+
+# Parts that are not normally compiled but need to be cleaned
+SDCC_EXTRA      = support/regression support/makebin
 
 SDCC_ASLINK    = as/mcs51 as link
 SDCC_PACKIHX   = packihx
 
-TARGETS         = sdcc-libs sdcc-cc sdcc-aslink
+TARGETS         = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc
 
-PKGS           = $(SDCC_LIBS) src $(SDCC_ASLINK)
+PKGS           = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC)
 
 ifneq ($(OPT_ENABLE_UCSIM), no)
 TARGETS         += sdcc-misc 
@@ -71,6 +69,9 @@ sdcc-device-tini:
        $(MAKE) -C device/include
        $(MAKE) -C device/lib modelDS390
 
+# Empty for now, as doc depends on latex and latex2html
+sdcc-doc:
+
 sdcc: $(TARGETS)
 
 sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx
@@ -114,10 +115,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)" -C $$pkg -f clean.mk clean ;\
        done
 
-
 # Deleting all files created by configuring or building the program
 # -----------------------------------------------------------------
 distclean:
@@ -125,9 +125,11 @@ 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)" -f clean.mk distclean ;\
+       done
+       for pkg in $(SDCC_EXTRA); do \
+         $(MAKE) -C $$pkg clean; \
        done
-
 
 # Like clean but some files may still exist
 # -----------------------------------------