summaryrefslogtreecommitdiffstats
path: root/pressure_control
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-25 12:00:46 +0100
committerMichael Buesch <mb@bu3sch.de>2009-11-25 12:00:46 +0100
commit10d9cf810fb316d6795b1668eee8af5102b878b2 (patch)
treebe9b69cdfce9de151ca48cb57b34b8e604f167f5 /pressure_control
parentf19ff5d3f3c510ff99ae52c43b749adf7afafbf5 (diff)
downloadcnc-10d9cf810fb316d6795b1668eee8af5102b878b2.tar.xz
cnc-10d9cf810fb316d6795b1668eee8af5102b878b2.zip
pressure_control: Basic sparse support
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control')
-rw-r--r--pressure_control/firmware/Makefile29
1 files changed, 20 insertions, 9 deletions
diff --git a/pressure_control/firmware/Makefile b/pressure_control/firmware/Makefile
index 2b21b8e..cfb0105 100644
--- a/pressure_control/firmware/Makefile
+++ b/pressure_control/firmware/Makefile
@@ -1,22 +1,32 @@
-ARCH ?= atmega8
-AVRDUDE_ARCH ?= m8
-AVRDUDE ?= avrdude
-AVRDUDE_SPEED ?= 1
-PROGRAMMER ?= avrisp2
-PROGPORT ?= usb
+ARCH = atmega8
+AVRDUDE_ARCH = m8
+AVRDUDE = avrdude
+AVRDUDE_SPEED = 1
+PROGRAMMER = avrisp2
+PROGPORT = usb
CC = avr-gcc
OBJCOPY = avr-objcopy
SIZE = avr-size
+SPARSE = sparse
-V = @
+V = @ # Verbose build: make V=1
+C = 0 # Sparsechecker build: make C=1
Q = $(V:1=)
QUIET_CC = $(Q:@=@echo ' CC '$@;)$(CC)
QUIET_OBJCOPY = $(Q:@=@echo ' OBJCOPY '$@;)$(OBJCOPY)
QUIET_SIZE = $(Q:@=@echo ' SIZE '$@;)$(SIZE)
+ifeq ($(C),1)
+QUIET_SPARSE = $(Q:@=@echo ' SPARSE '$@;)$(SPARSE)
+else
+QUIET_SPARSE = @/bin/true
+endif
-CFLAGS = -mmcu=$(ARCH) -std=gnu99 -g0 -O2 -Wall
-CFLAGS += "-Dinline=inline __attribute__((__always_inline__))"
+CFLAGS = -mmcu=$(ARCH) -std=gnu99 -g0 -O2 -Wall \
+ "-Dinline=inline __attribute__((__always_inline__))"
+SPARSEFLAGS = $(CFLAGS) -I "/usr/lib/avr/include" -D__AVR_ARCH__=4 \
+ -D__AVR_ATmega8__=1 -D__ATTR_PROGMEM__="" -Dsignal=dllexport \
+ -Dexternally_visible=dllexport
OBJECTS = main.o util.o valves.o sensor.o remote.o
@@ -43,6 +53,7 @@ remote.o: util.h remote.h calibration.h main.h valves.h
$(QUIET_CC) $(CFLAGS) -S $*.c
%.o: %.c
+ $(QUIET_SPARSE) $(SPARSEFLAGS) $<
$(QUIET_CC) -o $@ -c $(CFLAGS) $<
$(BIN): $(OBJECTS)
bues.ch cgit interface