Thanks for an answer. With your help I was able to come up with this piece:

--

PROG = ab
LD = $(CC)

SRCS = a.c b.c ../c-1up.c
OBJS = $(SRCS:.c=.o)

.c.o:
        $(CC) $(CFLAGS) -c -o $@ $<
.cpp.o:

        $(CXX) $(CXXFLAGS) -c -o $@ $<

all: $(PROG)

$(PROG): $(OBJS)
$(LD) -o $@ $(OBJS) $(LIBS)

--


Now, when I understand it, it works. It's not the same thing as objects are placed beside source files but step forward nevertheless.

I will check VPATH later.

Regards
Adam


Reply via email to