bsp,abstract-machine,Makefile: fix remake issue

* do not set a included Makefile as the target of a rule
This commit is contained in:
Zihao Yu 2023-05-26 08:00:15 +08:00
parent e6aa8c45f8
commit 4b1e2858ae

View file

@ -15,11 +15,11 @@ $(RTCONFIG_H):
touch $@
scons --useconfig=.config
$(FILE_MK): $(RTCONFIG_H)
init: $(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}' >> $@
cat $(FILE_TMP) | grep -o '[^ ]*.c$$' | awk '{print "SRCS += " $$1}' > $(FILE_MK)
cat $(FILE_TMP) | grep 'gcc ' | head -n 1 | grep -o " -I[^ ]*" | awk '{print "CFLAGS += " $$1}' >> $(FILE_MK)
rm $(FILE_TMP)
if [ "`sed -n '3p' $^`"x = x ]; then sed -i -e '2a#include "extra.h"' $^; fi
@ -28,6 +28,4 @@ menuconfig:
scons --genconfig
$(MAKE) init
init: $(FILE_MK)
.PHONY: init menuconfig