English 中文(简体)
我如何利用扩大宏观清单的美元(每美元)来编制文件?
原标题:How can I include makefiles using a $(foreach ) expansion of a macro list?
  • 时间:2024-01-10 23:42:59
  •  标签:
  • gnu-make

我怎么能做这样的事情呢?

DIRS =      app_interface/capi  
            chip/dep/chal       
            chip/dep/common     
            chip/dep/ml         
            chip/indep          
            cli/test_project    
            platform/reg_access 
            platform/utils

$(foreach dir,$(DIRS),-include $(dir)/.build/object_files.mk)

all:
    ... remainder of the makefile

基本上,如<代码>$(foreach ......)的声明,实际上是:

-include app_interface/capi/.build/object_files.mk
-include chip/dep/chal/.build/object_files.mk
... and so forth
问题回答

Why not the other way around?

DIRS = foo bar/moo

-include $(foreach dir,$(DIRS),$(dir)/.build/object_files.mk)




相关问题
Parallel building with gnumake and prerequisites

My first question (yay!) is about gnumake and parallel builds. Here s a quick example file: .PHONY: tool_1 tool_2 tool_3 tool_4 all tools all: | tools tools: | tool_2 tool_3 tool_4 tool_1: # ...

How to get absolute paths after vpath matching in make?

I have a makefile that depending on some properties sets vpath and generates a list of source files into one variable. I need to run the makefile without compiling anything (the compilation is ...

How do I see the commands that are run by GNU make?

I m trying to debug a complex Makefile. How do you get GNU make to print all the commands it runs? I couldn t find the answer in the man page (using the -d flag doesn t seem to print it). (This isn t ...

How to force an error in a gnumake file

I want to detect a condition in my makefile where a tool is the wrong version and force the make to fail with an error message indicating the item is not the right version. Can anyone give an example ...

Debugging GNU make

Is there a command line way in make to find out which of the prerequisites of a target is not updated?

热门标签