aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-07-04 11:47:19 +0200
committerClifford Wolf <clifford@clifford.at>2015-07-04 11:47:19 +0200
commit91f75bdf1fc2fcde9efb5de420caeacd89e2ce0e (patch)
tree2221dde6d623163f1bb0f87209c27b5171533cd0 /Makefile
parent2df7aadc7a4516d50d9d453a32332c14d81a7c0f (diff)
downloadpicorv32-91f75bdf1fc2fcde9efb5de420caeacd89e2ce0e.tar.gz
picorv32-91f75bdf1fc2fcde9efb5de420caeacd89e2ce0e.zip
Turned gcc warnings up to eleven
Patch by Larry Doolittle
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e5d07fd..ff8408b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
TEST_OBJS = $(addsuffix .o,$(basename $(wildcard tests/*.S)))
FIRMWARE_OBJS = firmware/start.o firmware/irq.o firmware/print.o firmware/sieve.o firmware/multest.o firmware/stats.o
-GCC_WARNS = -Wall -Wextra -Wshadow -Wundef
+GCC_WARNS = -Wall -Wextra -Wshadow -Wundef -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
+GCC_WARNS += -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -pedantic # -Wconversion
+TOOLCHAIN_PREFIX = riscv64-unknown-elf-
test: testbench.exe firmware/firmware.hex
vvp -N testbench.exe
@@ -44,23 +46,23 @@ firmware/firmware.hex: firmware/firmware.bin firmware/makehex.py
python3 firmware/makehex.py $< > $@
firmware/firmware.bin: firmware/firmware.elf
- riscv64-unknown-elf-objcopy -O binary $< $@
+ $(TOOLCHAIN_PREFIX)objcopy -O binary $< $@
chmod -x $@
firmware/firmware.elf: $(FIRMWARE_OBJS) $(TEST_OBJS) firmware/sections.lds
- riscv64-unknown-elf-gcc -Os -m32 -ffreestanding -nostdlib -o $@ \
+ $(TOOLCHAIN_PREFIX)gcc -Os -m32 -ffreestanding -nostdlib -o $@ \
-Wl,-Bstatic,-T,firmware/sections.lds,-Map,firmware/firmware.map,--strip-debug \
$(FIRMWARE_OBJS) $(TEST_OBJS) -lgcc
chmod -x $@
firmware/start.o: firmware/start.S
- riscv64-unknown-elf-gcc -c -m32 -o $@ $<
+ $(TOOLCHAIN_PREFIX)gcc -c -m32 -o $@ $<
firmware/%.o: firmware/%.c
- riscv64-unknown-elf-gcc -c -m32 -march=RV32I -Os $(GCC_WARNS) -ffreestanding -nostdlib -o $@ $<
+ $(TOOLCHAIN_PREFIX)gcc -c -m32 -march=RV32I -Os --std=c99 $(GCC_WARNS) -ffreestanding -nostdlib -o $@ $<
tests/%.o: tests/%.S tests/riscv_test.h tests/test_macros.h
- riscv64-unknown-elf-gcc -c -m32 -o $@ -DTEST_FUNC_NAME=$(notdir $(basename $<)) \
+ $(TOOLCHAIN_PREFIX)gcc -c -m32 -o $@ -DTEST_FUNC_NAME=$(notdir $(basename $<)) \
-DTEST_FUNC_TXT='"$(notdir $(basename $<))"' -DTEST_FUNC_RET=$(notdir $(basename $<))_ret $<
toc: