* support/regression/Makefile: Improved clean
[fw/sdcc] / support / regression / Makefile
index 67344aa9183b1b14d37d3d8c39e56dc9e41e2785..92057a7ea8e61be2e389b0ef25dbee65f6a99908 100644 (file)
@@ -20,8 +20,9 @@
 #       o Provides the emulators
 #   * The gbdk-lib package from gbdk.
 #       o cvs -d cvs.gbdk.sourceforge.net:/cvsroot/gbdk co gbdk-lib
-#       o Provildes mul, div, and include files for the z80 tests.
+#       o Proviles mul, div, and include files for the z80 tests.
 #   * python 1.5 or above
+#   * uCsim for the mcs51 port
 #
 # The paths below assume that sdcc, sdcc-extra, and gbdk-lib all reside in
 # the same directory.
@@ -60,7 +61,10 @@ GENERATE_CASES = generate-cases.py
 # The port name must be the same as the one used in the SDCC '-mxxx' argument.
 # Each port must have a spec.mk which describes how to build the object
 # files and how to run the emulator.
-ALL_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*)))
+ALL_PORTS = $(filter-out CVS mcs51 gbz80,$(notdir $(wildcard $(PORTS_DIR)/*)))
+
+# These  ports will be cleaned with 'make clean'
+CLEAN_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*)))                                                                 
 
 all: test-ports
 
@@ -72,9 +76,17 @@ test-ports:
 test-z80:
        $(MAKE) inter-port-clean test-port PORT=z80
 
+# Helper rule for testing the z80 port only
+test-gbz80:
+       $(MAKE) inter-port-clean test-port PORT=gbz80
+
+# Helper rule for testing the mcs51 small model port only
+test-mcs51:
+       $(MAKE) inter-port-clean test-port PORT=mcs51
+
 # Helper rule for testing the host cc only
 test-host:
-       $(MAKE) inter-port-clean clean test-port PORT=host
+       $(MAKE) inter-port-clean test-port PORT=host
 
 test-host2:
        $(MAKE) test-port PORT=host
@@ -92,6 +104,7 @@ PORT_RESULTS = $(ALL_TESTS:$(TESTS_DIR)/%.c=$(PORT_RESULTS_DIR)/%.out)
 SDCC_DIR = ../..
 SDCC_EXTRA_DIR = ../../../sdcc-extra
 
+
 # Defaults.  Override in spec.mk if required.
 # Path to SDCC
 SDCC = $(SDCC_DIR)/bin/sdcc
@@ -109,7 +122,7 @@ ifdef PORT
 include $(PORTS_DIR)/$(PORT)/spec.mk
 endif
 
-SDCCFLAGS += -Ifwk/include
+SDCCFLAGS += -Ifwk/include -Itests
 
 # List of intermediate files to keep.  Pretty much keep everything as
 # disk space is free.
@@ -169,8 +182,10 @@ $(RESULTS): $(SUB_RESULTS)
 
 # BeginGeneric rules
 
-clean:
-       rm -rf $(CASES_DIR) $(RESULTS_DIR)
+clean: inter-port-clean
+       rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc
+       for i in $(CLEAN_PORTS); do $(MAKE) -f $(PORTS_DIR)/$$i/spec.mk _clean PORT=$$i; done
 
 inter-port-clean:
-       rm -f  fwk/lib/*.o
+       rm -f  fwk/lib/*.o fwk/lib/*.asm fwk/lib/*.rst fwk/lib/*.lst fwk/lib/*.rel \
+               fwk/lib/*.ihx fwk/lib/*.map fwk/lib/*.sym