Makefile: build pitch_table.h properly
make it an actual target
This commit is contained in:
parent
00d233ebe5
commit
e30766e799
13
Makefile
13
Makefile
|
@ -62,11 +62,11 @@ OBJS := $(patsubst %.S, ${BUILD_DIR}/%_asm.o, ${OBJS})
|
||||||
PROGRAM := arduino-otp
|
PROGRAM := arduino-otp
|
||||||
|
|
||||||
# Build rules for different source types
|
# Build rules for different source types
|
||||||
${BUILD_DIR}/%.o: %.c
|
${BUILD_DIR}/%.o: %.c pitch_table.h
|
||||||
mkdir -p ${BUILD_DIR}
|
mkdir -p ${BUILD_DIR}
|
||||||
${CC} ${CFLAGS} -c $< -o $@
|
${CC} ${CFLAGS} -c $< -o $@
|
||||||
|
|
||||||
${BUILD_DIR}/%.o: %.cpp
|
${BUILD_DIR}/%.o: %.cpp pitch_table.h
|
||||||
mkdir -p ${BUILD_DIR}
|
mkdir -p ${BUILD_DIR}
|
||||||
${CXX} ${CFLAGS} -c $< -o $@
|
${CXX} ${CFLAGS} -c $< -o $@
|
||||||
|
|
||||||
|
@ -80,6 +80,9 @@ ${BUILD_DIR}/${PROGRAM}.elf: ${OBJS}
|
||||||
${BUILD_DIR}/${PROGRAM}.hex: ${BUILD_DIR}/${PROGRAM}.elf
|
${BUILD_DIR}/${PROGRAM}.hex: ${BUILD_DIR}/${PROGRAM}.elf
|
||||||
${OBJCOPY} -O ihex -R .eeprom $< $@
|
${OBJCOPY} -O ihex -R .eeprom $< $@
|
||||||
|
|
||||||
|
pitch_table.h: gen_pitch_table.py
|
||||||
|
python gen_pitch_table.py > pitch_table.h
|
||||||
|
|
||||||
define to-json-array
|
define to-json-array
|
||||||
$(shell echo '$(foreach path, $1, "${path}",)' | sed "s/,$$//")
|
$(shell echo '$(foreach path, $1, "${path}",)' | sed "s/,$$//")
|
||||||
endef
|
endef
|
||||||
|
@ -90,12 +93,13 @@ endef
|
||||||
mkdir -p .vscode
|
mkdir -p .vscode
|
||||||
sed 's@__includePaths__@$(call to-json-array, ${AVR_INC} ${VPATH} ${VARIANTS})@' c_cpp_properties.json.template > .vscode/c_cpp_properties.json
|
sed 's@__includePaths__@$(call to-json-array, ${AVR_INC} ${VPATH} ${VARIANTS})@' c_cpp_properties.json.template > .vscode/c_cpp_properties.json
|
||||||
|
|
||||||
.PHONY: all clean upload vscode pitch_table
|
.PHONY: all clean upload vscode
|
||||||
|
|
||||||
all: ${BUILD_DIR}/${PROGRAM}.hex
|
all: ${BUILD_DIR}/${PROGRAM}.hex
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ${BUILD_DIR}
|
rm -rf ${BUILD_DIR}
|
||||||
|
rm -rf pitch_table.h
|
||||||
|
|
||||||
upload: all
|
upload: all
|
||||||
ifndef PORT
|
ifndef PORT
|
||||||
|
@ -106,6 +110,3 @@ endif
|
||||||
vscode:
|
vscode:
|
||||||
rm -rf .vscode/c_cpp_properties.json
|
rm -rf .vscode/c_cpp_properties.json
|
||||||
make .vscode/c_cpp_properties.json
|
make .vscode/c_cpp_properties.json
|
||||||
|
|
||||||
pitch_table:
|
|
||||||
python gen_pitch_table.py > pitch_table.h
|
|
Loading…
Reference in a new issue