]> git.tdb.fi Git - model-railway-devices.git/blobdiff - common/build.mk
Drop the pretense of C89, put declarations where they make sense
[model-railway-devices.git] / common / build.mk
index 96d0f93a7f82b654df4512057a5b270e569edaa8..22d970cd813129f050516132b74677a4c2883643 100644 (file)
@@ -1,10 +1,11 @@
 MCU := atmega328p
 CLOCK := 16000000
 CC := avr-gcc
-CFLAGS := -Wall -Os -ffunction-sections -fdata-sections -mmcu=$(MCU) -DF_CPU=$(CLOCK) $(patsubst %,-D%,$(FEATURES)) -I../common
+CFLAGS := -Wall -std=c99 -Os -ffunction-sections -fdata-sections -mmcu=$(MCU) -DF_CPU=$(CLOCK) $(patsubst %,-D%,$(FEATURES)) -I../common
 LDFLAGS := -Os -Wl,--gc-sections -mmcu=$(MCU)
 AVRDUDE := avrdude
 OBJCOPY := avr-objcopy
+DEVICE := /dev/ttyUSB0
 ifeq ($(MCU),atmega168)
 BAUD := 19200
 else
@@ -34,7 +35,7 @@ help:
        $(CC) -c $(CFLAGS) -o $@ $<
 
 upload-%: %.hex
-       $(AVRDUDE) -p$(MCU) -carduino -P/dev/ttyUSB0 -b$(BAUD) -D -Uflash:w:$<:i
+       $(AVRDUDE) -p$(MCU) -carduino -P$(DEVICE) -b$(BAUD) -D -Uflash:w:$<:i
 
 clean:
        $(RM) *.hex