[問題] Makefile variable in subdir

作者: godman362 (蕭青)   2016-02-16 20:40:40
想請教關於Makefile中把variable傳入subdir的方式
關於export的部分我已經看過了,不過似乎沒辦法適用在我目前的狀況
我想實作的是像Kernel,經過config後,產生一個 .config 檔
然後整個Kernel source都會根據這個 .config 檔的variable進行判別編譯
例如 module 資料夾內容如下:
a d main.c Makefile config.mk
a folder: a1.c a2.c a3.c Makefile
Makefile(under a folder)的內容如下:
obj-$(CONFIG_A1) += a1.o
obj-$(CONFIG_A2) += a2.o
obj-$(CONFIG_A3) += a3.o

Links booklink

Contact Us: admin [ a t ] ucptt.com