[Top][All Lists]

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


From: Harvey Chapman
Subject: Re:
Date: Sun, 22 Mar 2009 23:39:55 -0400
User-agent: Postbox 1.0b9 (Macintosh/2009030821)

Mihai Draghicioiu wrote:
## Program template
define program_template
$(1)_OBJS = $$($(1)_SRCS:.cpp=.o)

Add a line here like this one.


## Library template
define library_template
$(2)_OBJS = $$($(2)_SRCS:.cpp=.o)

And another one here like this.


Then, move the .cpp.o target outside of the defines and just use one like this one. Note: The only thing I changed is the reference to $(SPECIFIC_CXXFLAGS) and I reduced all of the double dollar signs to single dollar signs since I was moving it out of the define.

@echo "$(COMPILERC)$(CXX) $(CXXFLAGS) $(SPECIFIC_CXXFLAGS) -MMD -c $< -o address@hidden(RESETC)";
    @if $(CXX) $(CXXFLAGS) $($SPECIFIC_CXXFLAGS) -MMD -c $< -o $@; then \
     cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
     rm -f $*.d; \
    else \
     echo "$(ERRORC)Compilation failed for $@ $(RESETC)"; \
     rm -f $*.d; \
     exit 1; \

Oh yeah, thanks for the hints. I've been working on something similar recently but from a different angle. My common makefile was designed for a single compile and to have everything be as automatic as possible. I think I should be able to eventually combine mine with your templates to make mine more robust.

reply via email to

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