]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/rules.mk
add version to make output
[qmk_firmware.git] / tmk_core / rules.mk
index e4c8aecb2cfa5a89213c324d44d1476f6503c3fe..c198f9edbb0dbafcb837ba5fe0fcf62ef5e2e3c8 100644 (file)
@@ -92,6 +92,9 @@ endif
 endif
 CFLAGS += -Wall
 CFLAGS += -Wstrict-prototypes
+ifneq ($(strip $(ALLOW_WARNINGS)), yes)
+    CFLAGS += -Werror
+endif
 #CFLAGS += -mshort-calls
 #CFLAGS += -fno-unit-at-a-time
 #CFLAGS += -Wundef
@@ -115,6 +118,9 @@ CPPFLAGS += -O$(OPT)
 CPPFLAGS += -w
 CPPFLAGS += -Wall
 CPPFLAGS += -Wundef
+ifneq ($(strip $(ALLOW_WARNINGS)), yes)
+    CPPFLAGS += -Werror
+endif
 #CPPFLAGS += -mshort-calls
 #CPPFLAGS += -fno-unit-at-a-time
 #CPPFLAGS += -Wstrict-prototypes
@@ -231,6 +237,10 @@ sizeafter: $(BUILD_DIR)/$(TARGET).hex
        # test file sizes eventually
        # @if [[ $($(SIZE) --target=$(FORMAT) $(TARGET).hex | $(AWK) 'NR==2 {print "0x"$5}') -gt 0x200 ]]; then $(SECHO) "File is too big!"; fi
 
+# Display qmk version information.
+qmkversion :
+       @$(SILENT) || printf "QMK Firmware v$(shell git describe --abbrev=0 --tags 2>/dev/null)\n\n"
+
 # Display compiler version information.
 gccversion :
        @$(SILENT) || $(CC) --version
@@ -269,7 +279,7 @@ gccversion :
        $(eval CMD=$(BIN) $< $@ || exit 0)
        @$(BUILD_CMD)
 
-BEGIN = gccversion sizebefore
+BEGIN = qmkversion gccversion sizebefore
 
 # Link: create ELF output file from object files.
 .SECONDARY : $(BUILD_DIR)/$(TARGET).elf
@@ -376,7 +386,7 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null)))
 
 
 # Listing of phony targets.
-.PHONY : all finish sizebefore sizeafter gccversion \
-build elf hex eep lss sym coff extcoff \
+.PHONY : all finish sizebefore sizeafter qmkversion \
+gccversion build elf hex eep lss sym coff extcoff \
 clean clean_list debug gdb-config show_path \
 program teensy dfu flip dfu-ee flip-ee dfu-start 
\ No newline at end of file