Clean up makefiles with a source grabber function
This commit is contained in:
18
mk/grabsrc.mk
Normal file
18
mk/grabsrc.mk
Normal file
@ -0,0 +1,18 @@
|
||||
define GRABSRC
|
||||
$(foreach item, $(1), $(wildcard $(item)/*.c) $(wildcard $(item)/*.S) $(wildcard $(item)/*.s))
|
||||
endef
|
||||
|
||||
define GET_CFILES
|
||||
$(filter %.c,$(1))
|
||||
endef
|
||||
|
||||
define GET_ASFILES
|
||||
$(filter %.S,$(1)) $(filter %.s,$(1))
|
||||
endef
|
||||
|
||||
define GET_OBJ
|
||||
$(patsubst %.c,%.o,$(filter %.c,$(1))) \
|
||||
$(patsubst %.S,%.o,$(filter %.S,$(1))) \
|
||||
$(patsubst %.s,%.o,$(filter %.s,$(1)))
|
||||
endef
|
||||
|
Reference in New Issue
Block a user