bug-make
[Top][All Lists]
Advanced

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

A problem with "-include"


From: Arham Amouei
Subject: A problem with "-include"
Date: Sat, 1 Jun 2019 19:47:12 +0430

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

reply via email to

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