help-make
[Top][All Lists]
Advanced

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

Troubles with makefile


From: VitalyP
Subject: Troubles with makefile
Date: Sun, 8 Jun 2008 08:26:41 -0700 (PDT)

I am doing simple codegen with makefile. File gen.c is generated from
gensrc.c. The example below works correctly and gen.c is generated
when gensrc.c has more recent timestamp

test: gen.c
    gcc -o $@ $<

gen.c: gensrc.c
    # here goes some codegen command


However in the example below gen.c is generated even if gensrc.c is
older than gen.c. That is target 'prebuild' is always considered as
not up-to date. Why is it so?

.PHONY: prebuild

test: gen.c
    gcc -o $@ $<

gen.c: prebuild

prebuild: gensrc.c
    # here goes some codegen command


-- 
View this message in context: 
http://www.nabble.com/Troubles-with-makefile-tp17719829p17719829.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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