diff --git a/Makefile-AVR b/Makefile-AVR index 4e0a0b9..7edaa6c 100644 --- a/Makefile-AVR +++ b/Makefile-AVR @@ -113,6 +113,7 @@ TARGET = $(PROGRAM).hex # to keep this working and can take a shortcut: SOURCES = $(wildcard *.c) +CFLAGS = $(EXTRA_CFLAGS) CFLAGS += -DF_CPU=$(F_CPU) CFLAGS += -DMCU_STR=\"$(MCU)\" CFLAGS += -mmcu=$(MCU) diff --git a/Makefile-SIM b/Makefile-SIM index baf4cd2..60fff20 100644 --- a/Makefile-SIM +++ b/Makefile-SIM @@ -44,6 +44,7 @@ SOURCES = $(wildcard *.c) SIM_SOURCES = $(subst $(SIM_PATH)/,,$(wildcard $(SIM_PATH)/*.c)) SOURCES := $(filter-out $(subst _sim.c,.c,$(SIM_SOURCES)),$(SOURCES)) $(SIM_SOURCES) +CFLAGS = $(EXTRA_CFLAGS) CFLAGS += -g -Wall -Wstrict-prototypes -Wno-format -Os $(DEFS) -std=gnu99 CFLAGS += -funsigned-char -funsigned-bitfields -fshort-enums -I.. -I. CFLAGS += -DSIMULATOR -Wno-format -Wno-format-security diff --git a/Makefile-common b/Makefile-common index 84c2d5b..0ce7532 100644 --- a/Makefile-common +++ b/Makefile-common @@ -107,3 +107,29 @@ $(BUILDDIR)/%.bin: $(BUILDDIR)/%.elf $(BUILDDIR)/%.sym: $(BUILDDIR)/%.elf @echo " SYM $@" @$(OBJDUMP) -t $< | perl -ne 'BEGIN { printf " ADDR NAME SIZE\n"; } /([0-9a-f]+)\s+(\w+)\s+O\s+\.(bss|data)\s+([0-9a-f]+)\s+(\w+)/ && printf "0x%04x %-20s +%d\n", eval("0x$$1") & 0xFFFF, $$5, eval("0x$$4")' | sort -k1 > $@ + + +# Helpful tools. + +.PHONY: regressiontests + +# Try to catch regressions. Put here whatever test can help to detect these +# and can be automated enough to allow to run them with a simple +# "make regressiontests". +regressiontests: + # Generic Gen7 configuration. + $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.regtest-gen7.h \ + MCU=atmega644 F_CPU=20000000UL EXTRA_CFLAGS=-Werror all + # Generic RAMPS configuration. + $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.regtest-ramps.h \ + MCU=atmega2560 F_CPU=16000000UL EXTRA_CFLAGS=-Werror all + # Generic Teensy2 configuration, which uses USB_SERIAL. + $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.regtest-teensy2.h \ + MCU=atmega32u4 F_CPU=16000000UL EXTRA_CFLAGS=-Werror all + # Don't forget the hostside simulator. + $(MAKE) -f Makefile-SIM all + @# Nonstandard builds go into a subdirectory of build/, see definition of + @# $(BUILDDIR) above. Let's clean that up on success. + rm -rf $(BUILDDIR)/testcases/ $(BUILDDIR)/sim/ + @echo + @echo "All regression tests ran successfully, you're fine to commit now." diff --git a/testcases/config.regtest-gen7.h b/testcases/config.regtest-gen7.h new file mode 100644 index 0000000..43936b2 --- /dev/null +++ b/testcases/config.regtest-gen7.h @@ -0,0 +1,6 @@ + +// Configuration for controller board. +#include "../config/board.gen7-v1.4.h" + +// Configuration for printer board. +#include "../config/printer.wolfstrap.h" diff --git a/testcases/config.regtest-ramps.h b/testcases/config.regtest-ramps.h new file mode 100644 index 0000000..9ea4f6f --- /dev/null +++ b/testcases/config.regtest-ramps.h @@ -0,0 +1,6 @@ + +// Configuration for controller board. +#include "../config/board.ramps-v1.3.h" + +// Configuration for printer board. +#include "../config/printer.mendel.h" diff --git a/testcases/config.regtest-teensy2.h b/testcases/config.regtest-teensy2.h new file mode 100644 index 0000000..52844e0 --- /dev/null +++ b/testcases/config.regtest-teensy2.h @@ -0,0 +1,6 @@ + +// Configuration for controller board. +#include "../config/board.teensy-v2.0.h" + +// Configuration for printer board. +#include "../config/printer.mendel.h"