Brandon
Brandon

Reputation: 23500

MakeFile Set Variable at Runtime

I have a makefile as follows.. At the first line that says windows.. Then on that same line, I try to set the variable to windows and jmp to $(WinDIR)/$(WinOUT)

How can I do that?

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.."

Upvotes: 0

Views: 753

Answers (1)

Beta
Beta

Reputation: 99094

Um...

windows: ObjDIR=Windows

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

But I'm not sure you understand how Make works. It won't "jump to" $(WinDIR)/$(WinOUT), it will -- perhaps -- execute the $(WinDIR)/$(WinOUT) rule first.

Upvotes: 1

Related Questions