[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with make rule

From: Oleksandr Gavenko
Subject: Re: Help with make rule
Date: Mon, 24 Jan 2011 12:08:14 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20101207 Thunderbird/3.1.7

On 20.01.2011 21:37, Paul Smith wrote:
I typically just force the directory to be created, with something like:

         __dummy := $(shell mkdir -p $(objdir))

This will be run before any rules.
I also pactice such pattern (look at BUILD_DIRS):


        $(CC) $(CPPFLAGS) $(CFLAGS) /MT /c /Fo$@ $<

        mkdir -p $@

Another practice I use:

.PHONY: dist
dist: init my.exe

.PHONY: init
        mkdir $(BUILD_DIR) $(DIST_DIR)

but this method have disadvantage: you can not
invoke 'make my.exe' directly as 'init' does not
present in dependency of 'my.exe'.

If it present as dependency in 'my.exe'
'my.exe' all time was rebuilt as 'init' target is '.PHONY'.

You must directly invoke 'make dist'.

С уважением, Александр Гавенко.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]