[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [MAKE ] undgå rebuild



Hej,

On 11:10 Sat 31 May 2008, Kristian Nørgaard wrote:
>  [...]
> Jeg vil gerne bygge "mit_target" som er afhængigt af nogle libs der 
> ligger i andre mapper.
> Jeg vil gerne sikre mig at alle $(LIBS) er up-to-date, men jeg vil jo 
> helst lade det være op til Makefilerne i de andre mapper at bestemme 
> hvorvidt af et lib er up-to-date.
> Altså vil jeg gerne at
> "make mit_target"
> altid indebærer at der udføres kommandoer a la:
> 
> make -C folder1 lib1
> make -C folder2 lib2
> 
> Det tænkte jeg kunne gøres med:
> -----------
> mit_target: $(OBJS) checklibs $(LIBS)
> 	buildkommando bla bla
> 
> checklibs:
> 	make -C folder1 lib1
> 	make -C folder2 lib2
> ----------
> 
> Men det får make til at bygge 'mit_target' hver eneste gang fordi 
> 'checklibs' regnes for en afhængighed der er nyere end 'mit_target'.

Jeg ville gøre noget lignende:

---
all: libs mit_target

libs:
	$(MAKE) -C ../lib1
	$(MAKE) -C ../lib2

mit_target: $(OBJ)
	$(CC) $< -o $@
---

Så vidt jeg husker er det vigtigt at man bruger $(MAKE) variablen til at
kalde make fra makefiler.

Mvh.
/Anders


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2008-06-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *