diff options
author | David Phillips <david@yeah.nah.nz> | 2020-12-20 22:22:17 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2020-12-20 22:22:17 +1300 |
commit | 75154ebdfbbfe7a04d21d910254058a757d2eef6 (patch) | |
tree | a4b2276da1b23a88fb15c434a2aaa7d6939c79b0 /Makefile | |
parent | 74dbe89a7574ccfc0238c9ec4f55ac4fd9d40949 (diff) | |
download | altimeter-75154ebdfbbfe7a04d21d910254058a757d2eef6.tar.xz |
Use float-enabled printf implementation
I hadn't realised there is a float-enabled printf implementation in AVR libc,
so let's use that instead of our own hack.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -5,8 +5,13 @@ QEMU_AVR ?= qemu-system-avr MCU ?= atmega32u4 SIM_MCU ?= atmega2560 -CFLAGS += -Wall -Wextra -DF_CPU=16000000UL -mmcu=$(MCU) -O3 -SIM_CFLAGS += -Wall -Wextra -DF_CPU=16000000UL -mmcu=$(SIM_MCU) -g3 -gdwarf-2 -DWDT_DISABLE +COMMON_CFLAGS += -Wall -Wextra -DF_CPU=16000000UL +CFLAGS += $(COMMON_CFLAGS) -mmcu=$(MCU) -O3 +SIM_CFLAGS += $(COMMON_CFLAGS) -mmcu=$(SIM_MCU) -g3 -gdwarf-2 -DWDT_DISABLE + +COMMON_LDFLAGS += -Wl,-u,vfprintf -lprintf_flt +LDFLAGS += $(COMMON_LDFLAGS) -mmcu=$(MCU) +SIM_LDFLAGS += $(COMMON_LDFLAGS) -mmcu=$(SIM_MCU) $(shell mkdir -p build/{real,sim}) @@ -26,14 +31,14 @@ build/altimeter.elf: \ build/real/display_sim.o \ build/real/altimeter.o \ build/real/util.o - $(CC) -o $@ $^ $(CFLAGS) + $(CC) -o $@ $^ $(LDFLAGS) build/altimeter_sim.elf: \ build/sim/barometer_sim.o \ build/sim/display_sim.o \ build/sim/altimeter.o \ build/sim/util.o - $(CC) -o $@ $^ $(SIM_CFLAGS) + $(CC) -o $@ $^ $(SIM_LDFLAGS) include config.mk |