help-make
[Top][All Lists]
Advanced

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

flat OBJDIR and SRCS everywhere


From: Alexander Farber
Subject: flat OBJDIR and SRCS everywhere
Date: Sun, 22 Aug 2004 21:24:19 +0000
User-agent: Mutt/1.4.1i

Hi,

I'm converting a scripted build system to GNU-makefiles
and would like to go my object files to the same place
as in the original build system - into one flat OBJDIR.

My problem is, how do I specify the dependency .obj <-> .cpp?

For example:

SRCS = ../generated/series60skinah/dllsrc/series60skinah_contentdll.cpp

Ok, the objects are relative easy to construct:

OBJS = $(addprefix $(OBJDIR)/, $(notdir $(SRCS:.cpp=.obj)))

But the following rule gives the error "prereq. not found":

$(OBJDIR)/%.obj: %.cpp
        $(CXX) $(CXXFLAGS) -o $@ $<

I don't think this is the case for VPATH, because I do 
know the exact path to the prerequisite .cpp-file already.

Also, I suspect my problem is that I'm trying to use 
different paths for the same file. But I can't say

$(OBJS): $(SRCS)
        $(CXX) $(CXXFLAGS) -o $@ $<

because there can be several files in the $(SRCS)...

Does anyone please have a hint for me how to handle this?

Regards
Alex 




reply via email to

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