bsp,am,Makefile: generate files.mk from scons commands
This commit is contained in:
parent
397bc03c19
commit
e5c449a67d
2 changed files with 18 additions and 2 deletions
1
bsp/abstract-machine/.gitignore
vendored
1
bsp/abstract-machine/.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
rtconfig.h
|
rtconfig.h
|
||||||
|
files.mk
|
||||||
|
|
|
@ -1,14 +1,29 @@
|
||||||
ARCH ?= native
|
ARCH ?= native
|
||||||
|
FILE_MK = files.mk
|
||||||
|
FILE_TMP = .tmp.$(FILE_MK)
|
||||||
RTCONFIG_H = rtconfig.h
|
RTCONFIG_H = rtconfig.h
|
||||||
|
|
||||||
NAME = rtthread
|
NAME = rtthread
|
||||||
SRCS =
|
SRCS =
|
||||||
|
-include $(FILE_MK)
|
||||||
include $(AM_HOME)/Makefile
|
include $(AM_HOME)/Makefile
|
||||||
|
|
||||||
$(RTCONFIG_H):
|
$(RTCONFIG_H):
|
||||||
touch $@
|
touch $@
|
||||||
scons --useconfig=.config
|
scons --useconfig=.config
|
||||||
|
|
||||||
init: $(RTCONFIG_H)
|
$(FILE_MK): $(RTCONFIG_H)
|
||||||
|
scons -c
|
||||||
|
scons --verbose -n > $(FILE_TMP)
|
||||||
|
cat $(FILE_TMP) | grep -o '[^ ]*.c$$' | awk '{print "SRCS += " $$1}' > $@
|
||||||
|
cat $(FILE_TMP) | grep 'gcc ' | head -n 1 | grep -o " -I[^ ]*" | awk '{print "CFLAGS += " $$1}' >> $@
|
||||||
|
rm $(FILE_TMP)
|
||||||
|
|
||||||
.PHONY: init
|
menuconfig:
|
||||||
|
scons --menuconfig
|
||||||
|
scons --genconfig
|
||||||
|
$(MAKE) init
|
||||||
|
|
||||||
|
init: $(FILE_MK)
|
||||||
|
|
||||||
|
.PHONY: init menuconfig
|
||||||
|
|
Loading…
Add table
Reference in a new issue