Hi

My makefile comes below. When the folder is clean and I enter make
clean I receive

mpicc -MM *.c > depend.mk
rm -f *.o libfmd.so depend.mk

It seems to me that -include depend.mk in addition to including depend.mk,
executes the rule that depend.mk is its target. I'd like to stop this
behavior. Found nothing helpful in the manual for this purpose.

CC = mpicc
SHAREDLIB = libfmd.so
CFLAGS = -fPIC -Wall -Wno-unused-result -O3 -fopenmp
LFLAGS = -lm -fopenmp -lgsl -lgslcblas

OBJS ::= $(patsubst %.c,%.o,$(wildcard *.c))

.PHONY: all shared clean
all: shared
shared: $(SHAREDLIB)
$(SHAREDLIB): depend.mk $(OBJS)
        $(CC) $(OBJS) -shared -o $@ $(LFLAGS)
depend.mk: *.c *.h
        $(CC) -MM *.c > depend.mk
-include depend.mk
clean:
        rm -f *.o libfmd.so depend.mk

Kind regards,

Arham
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to