始终与默认目标一起运行目标

时间:2018-08-05 09:23:36

标签: makefile

我有一个默认的目标“ all”,但是我每次运行makefile时都要初始化一些变量。不管是什么目标。

cat Makefile

all: last_step 

initialize:  
 ifeq (,$(filter $(ps),0 1)) 
 @$(eval override ps=0) 
 endif 

step1:  
 <> 
step2: step1 
 <> 
....  
last_step: second_last_step 
 <> 

我想在每次运行make文件时初始化变量。 初始化目标应在以下两种流样式中运行。

make。

第n步

1 个答案:

答案 0 :(得分:0)

没有什么比这容易的了

ifeq (,$(filter $(ps),0 1)) 
override ps=0
endif 

all: last_step 
    ...

step1:  
    ...

...
相关问题