[EMAIL PROTECTED] wrote:
> I think I've found a simple enough solution to this problem.

I have another solution, but as you already have found a solution which
works you might not want to use my way:

-8<---------------------------------
all: myprog
 
myprog: mysrc.c ../lib/mylib.a
        gcc -o $@ $^
 
../lib/mylib.a: FORCE
        cd ../lib && $(MAKE)
 
# Used to force some rules to always be compiled
FORCE: ;
-8<---------------------------------

The above Makefile doesn't know anything about how mylib.a is made.
Instead it allways calls another makefile who has the responsibility to
update mylib.a if needed.

Only if mysrc.c or mylib.a has been updated myprog will be rebuilt.

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc1(at)poolhem.se Examples of addresses which go to spammers:
[EMAIL PROTECTED] [EMAIL PROTECTED]

_______________________________________________
help-gnu-utils mailing list
help-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils

Reply via email to