Changed default documentation dir to share/doc/sdcc
[fw/sdcc] / support / regression / Makefile
index 6dc26b0bcfb92ba00587f0b4e416e0206bf0564c..6f3d751fa0b875e17c073c827c37b2437cedb7ea 100644 (file)
 # re-run.  Changing one suite causes just that to be run.  Changing
 # one of the library files should cause all to re-run
 
-# Old nores:
+# Dependancies:
+#   * The sdcc-extra package, available from CVS.
+#       o cvs -d cvs.sdcc.sourceforge.net:/cvsroot/sdcc co sdcc-extra
+#       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.
+#   * python 1.5 or above
+#
+# The paths below assume that sdcc, sdcc-extra, and gbdk-lib all reside in
+# the same directory.
+
+# Old notes:
 # Starting at the bottom
 # Set of source test suites
 # Each source suite is processesd producing multiple device specific test suites.
 
 # Uncomment this to show only errors and the summary.
 # Comment this out for debugging.
-.SILENT:
+#.SILENT:
 
 # All original tests live in TESTS_DIR and below
-TESTS_DIR = tests
+TESTS_DIR = tests-min
+TESTS_NAME = $(TESTS_DIR)
 # All suite results go in RESULTS_DIR
 RESULTS_DIR = results
 # All data relating to supported ports live in their own directory
@@ -49,10 +62,23 @@ GENERATE_CASES = generate-cases.py
 # files and how to run the emulator.
 ALL_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*)))
 
+all: test-ports
+
 # Test all of the ports
 test-ports:
        for i in $(ALL_PORTS); do $(MAKE) inter-port-clean test-port PORT=$$i; done
 
+# Helper rule for testing the z80 port only
+test-z80:
+       $(MAKE) inter-port-clean clean test-port PORT=z80
+
+# Helper rule for testing the host cc only
+test-host:
+       $(MAKE) inter-port-clean clean test-port PORT=host
+
+test-host2:
+       $(MAKE) test-port PORT=host
+
 # Begin per-port rules
 # List of all of the known source test suites.
 ALL_TESTS = $(shell find $(TESTS_DIR) -name "*.c")
@@ -63,9 +89,12 @@ PORT_RESULTS_DIR = $(RESULTS_DIR)/$(PORT)
 # Each test generates a result log file
 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 = ../../bin/sdcc
+SDCC = $(SDCC_DIR)/bin/sdcc
 # Base flags.
 SDCCFLAGS = -m$(PORT)
 # Extension of object intermediate files
@@ -88,11 +117,12 @@ SDCCFLAGS += -Ifwk/include
 
 # Rule to generate the iterations of a test suite off the soure suite.
 $(PORT_CASES_DIR)/%$(DIREXT): $(TESTS_DIR)/%.c $(GENERATE_CASES)
-       rm -rf $(CASES_DIR)/tests
-       mkdir -p $(CASES_DIR)/tests
+       echo Processing $<
+       rm -rf $(CASES_DIR)/$(TESTS_NAME)
+       mkdir -p $(CASES_DIR)/$(TESTS_NAME)
        mkdir -p $@
        python $(GENERATE_CASES) $< > /dev/null
-       cp $(CASES_DIR)/tests/*.c $@
+       cp $(CASES_DIR)/$(TESTS_NAME)/*.c $@
        touch $@
 
 # Rule linking the combined results log to all of the files in the
@@ -114,7 +144,7 @@ test-port: port-results
 # test
 
 # List of all of the generated iteration source files.
-SUB_CASES = $(wildcard $(CASES)/*.c)
+SUB_CASES = $(sort $(wildcard $(CASES)/*.c))
 # List of all the sub result logs generated from the iterations.
 SUB_RESULTS = $(SUB_CASES:%.c=%.out)
 # Overall target.  Concatenation of all of the sub results.