config initial test
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
d2ef885e8d
commit
552f45c258
17 changed files with 168 additions and 20 deletions
30
scripts/Makefile.build
Normal file
30
scripts/Makefile.build
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# kernel makefile
|
||||
-include .config
|
||||
|
||||
include $(obj)Makefile
|
||||
|
||||
# 1. Filter subdirectories (items ending in /) from files
|
||||
subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
|
||||
real-objs-y := $(filter-out %/, $(obj-y))
|
||||
|
||||
# 2. Target to build everything in this directory
|
||||
__build: $(subdir-y) $(real-objs-y)
|
||||
@echo " Built-in $(obj)"
|
||||
|
||||
# 3. Rule to descend into subdirectories
|
||||
$(subdir-y):
|
||||
@$(MAKE) -f scripts/Makefile.build obj=$(obj)$@/
|
||||
|
||||
# 4. Standard rule to compile .c files to .o
|
||||
%.o: %.c
|
||||
@echo " CC $(obj)$@"
|
||||
@$(CC) $(CFLAGS) -c $< -o $(obj)$@
|
||||
|
||||
%.o: %.S
|
||||
@echo " CC $(obj)$@"
|
||||
@$(CC) $(CFLAGS) -c $< -o $(obj)$@
|
||||
|
||||
|
||||
.PHONY: __build $(subdir-y)
|
||||
|
||||
Loading…
Reference in a new issue