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, w
On Mon, 2022-01-24 at 21:27 +0100, Adam Tuja wrote:
> SRCS = a.c b.c ../c-1up.c
> OBJS = $(SRCS:.c=.o)
>
> .c.o:
> $(CC) $(CFLAGS) -c -o $@ $<
>
> $(PROG): $(OBJS)
>
> Now, when I understand it, it works. It's not the same thing as
> objects are placed beside source files but step forwar
On Mon, 2022-01-24 at 19:09 +0100, Adam Tuja wrote:
> It doesn't matter how with many levels above current directory the
> path has (../ ../../ ...), it's still the same.
Suffix rules are very limited: this is why pattern rules were invented.
As long as you're happy with creating the object file
Hello,I had this problem trying to compile a source with relative paths above current/working directory level. I took me hours of frustration to make work and, it eventually didn't.Then, by a chance I realised that when I use a path within current working directory it more or less works.It doesn't