MakeFile在运行时设置变量

时间:2013-03-16 02:48:29

标签: makefile gnu-make

我有一个makefile如下..在第一行说窗口..然后在同一行,我尝试将变量设置为windows,jmp设置为$(WinDIR)/ $(WinOUT)

我该怎么做?

windows: ObjDIR=Windows $(WinDIR)/$(WinOUT)
    @echo
    @echo "Finished Making windows.."

clean:
    @echo "    Cleaning Build Files."
    @rm -rf $(BinDIR) $(ObjDIR)

$(WinDIR)/$(WinOUT): $(ObjFiles)
    @echo
    @echo "Linking Object Files.."

1 个答案:

答案 0 :(得分:1)

嗯...

windows: ObjDIR=Windows

windows: $(WinDIR)/$(WinOUT)
    @echo
    @echo "Finished Making windows.."

但我不确定你是否了解Make的工作原理。它不会跳到" $(WinDIR)/$(WinOUT),它可能 - 首先执行$(WinDIR)/$(WinOUT)规则。