]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Move git submodule check and version generation to main Makefile
authorFred Sundvik <fsundvik@gmail.com>
Mon, 8 Aug 2016 08:19:29 +0000 (11:19 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sat, 20 Aug 2016 00:56:32 +0000 (03:56 +0300)
Makefile
build_keyboard.mk
tmk_core/rules.mk

index fc615720948d10f562d4e3df2d71e5d7579fb576..caa8f2de1c7c56f457c255be64c7b480af77d43f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -262,6 +262,13 @@ $(SUBPROJECTS): %: %-allkm
 .PHONY: %
 %: 
        cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
+       git submodule status --recursive 2>/dev/null | \
+       while IFS= read -r x; do \
+               case "$$x" in \
+                       \ *) ;; \
+                       *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
+               esac \
+       done
        $(eval $(call PARSE_RULE,$@))
        $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
        
@@ -275,3 +282,8 @@ all-keyboards: allkb-allsp-allkm
 .PHONY: all-keyboards-defaults
 all-keyboards-defaults: allkb-allsp-default
 
+
+GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
+BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
+$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
+$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
\ No newline at end of file
index 7493c1328506007fea036bf3abb3bf43e2939d7a..7d284cfa7b4e64a59123ae984d987cd4be8397de 100644 (file)
@@ -183,9 +183,4 @@ endif
 
 include $(TMK_PATH)/rules.mk
 
-GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
-BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
 OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
-
-$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h)
-$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h)
\ No newline at end of file
index 9aa4ac8cf85b7614bb89c08eed0b97abf7a99d60..e8e3de57198bca51817ccdda6a74c33bc1d7a42d 100644 (file)
@@ -267,15 +267,6 @@ sym: $(BUILD_DIR)/$(TARGET).sym
 LIBNAME=lib$(TARGET).a
 lib: $(LIBNAME)
 
-check_submodule:
-       git submodule status --recursive | \
-       while IFS= read -r x; do \
-               case "$$x" in \
-                       \ *) ;; \
-                       *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
-               esac \
-       done
-
 # Display size of file.
 HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
@@ -337,7 +328,7 @@ gccversion :
        $(eval CMD=$(AR) $@ $(OBJ) )
        @$(BUILD_CMD)
 
-BEGIN = gccversion check_submodule sizebefore
+BEGIN = gccversion sizebefore
 
 # Link: create ELF output file from object files.
 .SECONDARY : $(BUILD_DIR)/$(TARGET).elf
@@ -443,6 +434,6 @@ $(shell mkdir $(KBOBJDIR) 2>/dev/null)
 
 # Listing of phony targets.
 .PHONY : all finish sizebefore sizeafter gccversion \
-build elf hex eep lss sym coff extcoff check_submodule \
+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