I know that Make’s default behaviour is to delete intermediate files. I also added the .INTERMEDIATE special target to delete all intermediate .o files but Make is still not deleting them.
I’ve read all other posts with similar issues on Stackoverflow , followed what the answers suggested and nothing worked for me. Could someone please take a look? Here’s my Make:
CC = gcc
CFLAGS = -Wall -Werror -Wmissing-prototypes
OBJS = server.o rio.o list.o
LDLIBS = -lpthread
.INTERMEDIATE: %.o
all: syst
sysstatd: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDLIBS) -o syst -L thread-pool -lthreadpool
server.o: server.h server.c
rio.o: rio.h rio.c
list.o: list.h list.c
clean:
rm -f *~ *.o syst
Thanks!
Personally, I’d use
I don’t believe you can use
%syntax in.INTERMEDIATEtargets, and*.ostrikes me as far too risky. However, since you already have a convenient list of object files, why not just use it?