[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make with another make as a prerequisite
From: |
Henrik Carlqvist |
Subject: |
Re: Make with another make as a prerequisite |
Date: |
Fri, 02 Mar 2007 21:13:39 +0100 |
User-agent: |
Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) |
crjjrc@gmail.com 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:
root@localhost postmaster@localhost