2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 # Collect dummy C files in firmware/asm
11 ASM_DUMMY_SRC
:= $(notdir $(call preprocess
, $(FIRMDIR
)/asm
/SOURCES
))
13 # Get the corresponding real source files under firmware/asm/$ARCH (C or ASM)
14 ASM_C_SRC
:= $(addprefix $(FIRMDIR
)/asm
/$(ARCH
)/,$(ASM_DUMMY_SRC
))
15 ASM_S_SRC
:= $(ASM_C_SRC
:.c
=.S
)
17 # ASM_SRC now contains only files that exist under $ARCH
18 ASM_SRC
:= $(wildcard $(ASM_C_SRC
))
19 ASM_SRC
+= $(wildcard $(ASM_S_SRC
))
21 # GEN_SRC now contains a .c for each file in ASM_DUMMY_SRC that's not in ASM_SRC
22 # I.e. fallback to a generic C source if no corresponding file in $ARCH is found
23 GEN_SRC
:= $(filter-out $(notdir $(ASM_SRC
:.S
=.c
)),$(ASM_DUMMY_SRC
))
24 GEN_SRC
:= $(addprefix $(FIRMDIR
)/asm
/,$(GEN_SRC
))
26 FIRMLIB_SRC
+= $(ASM_SRC
)
27 FIRMLIB_SRC
+= $(GEN_SRC
)