makefile
This commit is contained in:
parent
2e29c6fcb5
commit
ae6920cdf9
|
@ -28,7 +28,9 @@ OBJECTS = main.o spi.o mcp23s17.o tlc5615.o adu.o selftest.o global_vars.o us
|
||||||
COMPILE = $(COMPILER_PATH) $(CFLAGS)
|
COMPILE = $(COMPILER_PATH) $(CFLAGS)
|
||||||
FUSES = (E:$(EFUSE), H:$(HFUSE), L:$(LFUSE))
|
FUSES = (E:$(EFUSE), H:$(HFUSE), L:$(LFUSE))
|
||||||
|
|
||||||
b15f: $(OBJECTS)
|
.PHONY: commit_hash
|
||||||
|
|
||||||
|
b15f: commit_hash $(OBJECTS)
|
||||||
@echo "Linking binary..."
|
@echo "Linking binary..."
|
||||||
$(COMPILE) $(OBJECTS) -o $(OUTPUT) $(LDFLAGS)
|
$(COMPILE) $(OBJECTS) -o $(OUTPUT) $(LDFLAGS)
|
||||||
|
|
||||||
|
@ -51,5 +53,9 @@ upload: b15f checkfuses
|
||||||
@echo "Uploading hex file..."
|
@echo "Uploading hex file..."
|
||||||
avrdude -v -Pusb -p $(MCU) -c $(PROGRAMMER) -U flash:w:$(HEX)
|
avrdude -v -Pusb -p $(MCU) -c $(PROGRAMMER) -U flash:w:$(HEX)
|
||||||
|
|
||||||
|
commit_hash:
|
||||||
|
@echo "Updating commit hash..."
|
||||||
|
@echo -e "#ifndef COMMIT_HASH_H\n#define COMMIT_HASH_H\nconstexpr char* COMMIT_HASH = \"`git log --pretty=format:'%H' -n 1`\";\n#endif // COMMIT_HASH_H" > commit_hash.h
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
$(COMPILE) -c $< -o $@
|
$(COMPILE) -c $< -o $@
|
||||||
|
|
4
firmware/commit_hash.h
Normal file
4
firmware/commit_hash.h
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef COMMIT_HASH_H
|
||||||
|
#define COMMIT_HASH_H
|
||||||
|
constexpr char* COMMIT_HASH = "2e29c6fcb5debd952e967adc773d396b7f645450";
|
||||||
|
#endif // COMMIT_HASH_H
|
Loading…
Reference in a new issue