help-make
[Top][All Lists]
Advanced

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

Creating an obj/ directory?


From: Jeffrey Walton
Subject: Creating an obj/ directory?
Date: Thu, 1 Sep 2011 22:53:13 -0400

Hi All,

I'm working with a project that has a modest tree structure. The *.o
files are currently being placed next to their *.cpp counterparts. I
would like to move them to an obj/ directory, maintaining the same
structure.

I tried:

CODECSRCS = codec/HTMLCodec.cpp \
                          ....

CRYPTOSRCS = crypto/MessageDigest.cpp \
                          ....

CODECOBJS = $(addprefix,obj/,$(CODECSRCS))
CRYPTOOBJS = $(addprefix,obj/,$(CRYPTOSRCS))

The problem is that our CPP build rule is getting in the way ('don't
know how to make X'):

.cpp.o:
        $(CXX) $(CXXFLAGS) $(INCLUDES) -fpic -c $< -o $@

If we change the build rule to output to objects, final linking is
blowing up (even with -L./obj):

.cpp.o:
        $(CXX) $(CXXFLAGS) $(INCLUDES) -fpic -c $< -o obj/$@

Any recommendations on the best way to proceed would be appreciated.

Jeff



reply via email to

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