help-make
[Top][All Lists]
Advanced

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

Re: Automatically generate rules from a list variable


From: Andrei Deftu
Subject: Re: Automatically generate rules from a list variable
Date: Fri, 24 Oct 2008 20:53:20 +0300

Thank you all. The problem is solved. Here is the template I was looking for:

TARGETS := main1
main1_DEPENDS  := modul1.cpp_o modul2.cpp_o

SOURCES_CPP := modul1.cpp modul2.cpp main1.cpp
modul1.cpp_DEPENDS  := modul1.h
modul2.cpp_DEPENDS  := modul2.h

OBJS_CPP := $(SOURCES_CPP:=_o)
.SECONDEXPANSION:
$(OBJS_CPP): %.cpp_o: %.cpp $$(%.cpp_DEPENDS)
    @echo CC $@: $^

.SECONDEXPANSION:
$(TARGETS): $$(address@hidden)
    @echo LINK $@: $^

This template can be expanded and then used for more general purpose
applications.




reply via email to

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