Makefile: Move listing of directories to create to board makefiles
Rename DIRS to dirs-y and populate it in the per-board Makefile rules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
8e1c0941b0
commit
4dd3478fc1
6
Makefile
6
Makefile
|
@ -26,7 +26,7 @@ PYTHON=python
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
src-y=sched.c command.c stepper.c basecmd.c gpiocmds.c spicmds.c endstop.c
|
src-y=sched.c command.c stepper.c basecmd.c gpiocmds.c spicmds.c endstop.c
|
||||||
DIRS=src src/avr src/simulator src/generic lib/pjrc_usb_serial
|
dirs-y=src
|
||||||
|
|
||||||
# Default compiler flags
|
# Default compiler flags
|
||||||
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
|
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
|
||||||
|
@ -70,6 +70,7 @@ $(OUT)%.o: %.c $(OUT)autoconf.h $(OUT)board-link
|
||||||
|
|
||||||
$(OUT)board-link: $(KCONFIG_CONFIG)
|
$(OUT)board-link: $(KCONFIG_CONFIG)
|
||||||
@echo " Creating symbolic link $(OUT)board"
|
@echo " Creating symbolic link $(OUT)board"
|
||||||
|
$(Q)mkdir -p $(addprefix $(OUT), $(dirs-y))
|
||||||
$(Q)touch $@
|
$(Q)touch $@
|
||||||
$(Q)ln -Tsf $(PWD)/src/$(CONFIG_BOARD_DIRECTORY) $(OUT)board
|
$(Q)ln -Tsf $(PWD)/src/$(CONFIG_BOARD_DIRECTORY) $(OUT)board
|
||||||
$(Q)mkdir -p $(OUT)board-generic
|
$(Q)mkdir -p $(OUT)board-generic
|
||||||
|
@ -98,7 +99,6 @@ $(OUT)klipper.elf: $(OUT)klipper.o $(OUT)compile_time_request.o
|
||||||
define do-kconfig
|
define do-kconfig
|
||||||
$(Q)mkdir -p $(OUT)/scripts/kconfig/lxdialog
|
$(Q)mkdir -p $(OUT)/scripts/kconfig/lxdialog
|
||||||
$(Q)mkdir -p $(OUT)/include/config
|
$(Q)mkdir -p $(OUT)/include/config
|
||||||
$(Q)mkdir -p $(addprefix $(OUT), $(DIRS))
|
|
||||||
$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1
|
$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -122,4 +122,4 @@ clean:
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(Q)rm -f .config .config.old
|
$(Q)rm -f .config .config.old
|
||||||
|
|
||||||
-include $(patsubst %,$(OUT)%/*.d,$(DIRS))
|
-include $(patsubst %,$(OUT)%/*.d,$(dirs-y))
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
# Use the avr toolchain
|
# Use the avr toolchain
|
||||||
CROSS_PREFIX=avr-
|
CROSS_PREFIX=avr-
|
||||||
|
|
||||||
|
dirs-y += src/avr lib/pjrc_usb_serial
|
||||||
|
|
||||||
CFLAGS-y += -mmcu=$(CONFIG_MCU) -DF_CPU=$(CONFIG_CLOCK_FREQ)
|
CFLAGS-y += -mmcu=$(CONFIG_MCU) -DF_CPU=$(CONFIG_CLOCK_FREQ)
|
||||||
LDFLAGS-y += -Wl,--relax
|
LDFLAGS-y += -Wl,--relax
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# Additional simulator build rules
|
# Additional simulator build rules
|
||||||
|
|
||||||
|
dirs-y += src/simulator src/generic
|
||||||
|
|
||||||
src-y += simulator/main.c simulator/gpio.c
|
src-y += simulator/main.c simulator/gpio.c
|
||||||
src-y += generic/crc16_ccitt.c generic/alloc.c
|
src-y += generic/crc16_ccitt.c generic/alloc.c
|
||||||
|
|
Loading…
Reference in New Issue