help-make
[Top][All Lists]
Advanced

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

Several source dirs, but one flat objdir


From: Alexander Farber
Subject: Several source dirs, but one flat objdir
Date: Wed, 18 Aug 2004 15:00:06 +0000
User-agent: Mutt/1.4.1i

Hi,

I'm trying to convert a batch-files/perl-scripts build system
to regular GNU-makefiles. One problem of me is that while there
are several directories und sub-directoris holding the source 
files, there is only one directory (called OBJDIR below) which
holds the object files:

    SRCS = ../src1/Sae.cpp \
           ../src1/SaeSysAgentNotifier.cpp \ 
           ../sra1/SaeEtelObserver.cpp \ 
           ../sra2/SaeGprsAvailabilityObs.cpp \ 
           ../src2/SaeDosObserver.cpp \ 
           ../src2/SaeConnMonObs.cpp

Now, I can get the list of object files for example like this:

    OBJS = $(addprefix $(OBJDIR)/, $(notdir $(SOURCE:.cpp=.o)))

But how do I specify rules for building those object files?
I can write neither

        $(SRCS): $(OBJDIR)/%.o: %.c
nor:
        $(OBJS): %.o: %.c

Is VPATH (or "vpath %.c") meant for this kind of problems?
I'm worried that if I use VPATH, then I'll have filenames
clashes (ok, the current batch/perl system would have them too).

Is there maybe another way to solve it (by some string manipulations)?

Thank you
Alex




reply via email to

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