日期:2014-05-16 浏览次数:20837 次
user@ubuntu:/dev/shm/test$ ls app/
1.c 2.c sub.mk
user@ubuntu:/dev/shm/test$ cat app/sub.mk
export var += $(wildcard *.c)
user@ubuntu:/dev/shm/test$ cat Makefile
var +=
include ./app/sub.mk
default:
@echo $(var)
user@ubuntu:/dev/shm/test$ make
3.c 4.c
user@ubuntu:/dev/shm/test$ ls
3.c 4.c app Makefile
user@ubuntu:/dev/shm/test$
user@ubuntu:/dev/shm/test$ cat app/sub.mk
export var += $(wildcard $(subdir)/*.c)
user@ubuntu:/dev/shm/test$ cat Makefile
var +=
subdir=app
include $(subdir)/sub.mk
default:
@echo $(var)
user@ubuntu:/dev/shm/test$ make
app/1.c app/2.c
user@ubuntu:/dev/shm/test$