forked from alexforencich/xboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h.mk
22 lines (21 loc) · 634 Bytes
/
config.h.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
config.h: config.mk
@echo "Generating config.h for $(MCU)"
@echo "// XBoot config header file" > config.h
@echo "// MCU: $(MCU)" >> config.h
@echo "// F_CPU: $(F_CPU)" >> config.h
@echo >> config.h
@$(foreach v, \
$(sort $(filter-out USE_CONFIG_H, $(filter \
ATTACH_% \
ENABLE_% \
ENTER_% \
FIFO_% \
I2C_% \
LED_% \
UART_% \
USE_% \
WATCHDOG_%, $(.VARIABLES)))), \
if [ "$($(v))" = "y" ] || [ "$($(v))" = "yes" ] ; then \
echo "#define $(v)" >> config.h ; \
elif [ -n "$($(v))" ] && [ "$($(v))" != "n" ] && [ "$($(v))" != "no" ] ; then \
echo "#define $(v) $($(v))" >> config.h ; fi ;)