Fix make target redefinition error for BUILD_ID

master
informatic 2017-09-30 09:07:29 +02:00
parent 250fd39268
commit 318b378c54
1 changed files with 4 additions and 4 deletions

View File

@ -39,13 +39,13 @@ else
include $(SMING_HOME)/Makefile-project.mk
endif
$(APP_AR): $(OBJ)
$(vecho) "AR $@"
# Add BUILD_ID versioning
$(APP_AR): $(BUILD_BASE)/ver.o
OBJ += $(BUILD_BASE)/ver.o
$(BUILD_BASE)/ver.o:
@echo "char* BUILD_ID = \"$(shell git rev-parse --short HEAD)-$(shell TZ=UTC date +%Y%m%d-%H%M%S)\";" > $(BUILD_BASE)/ver.c
$(Q) $(CC) -c $(BUILD_BASE)/ver.c -o $(BUILD_BASE)/ver.o
$(Q) $(AR) cru $@ $^ $(BUILD_BASE)/ver.o
ota: all
-mkdir ../master/ota/$(DEVICE) >/dev/null