Makefile: move -MMD option out of CFLAGS

This commit is contained in:
John 2022-04-05 18:07:58 -05:00
parent 9a63c16cd2
commit e16a4396d7

View File

@ -11,7 +11,7 @@ VPATH = $(SPATH) $(IPATH) $(DPATH) $(OPATH)
# compiler and compiler flags
CC = g++
CFLAGS = -MMD -I$(IPATH) -pthread -lrt
CFLAGS = -I$(IPATH) -pthread -lrt
# list of object files
SOURCES = $(wildcard $(SPATH)/*.cpp)
@ -39,7 +39,7 @@ $(DPATH) $(OPATH):
$(CC) $(CFLAGS) -o $@ $^
# Make the object and dependency files
$(OPATH)/%.o: $(SPATH)/%.cpp
$(CC) $(CFLAGS) -MF $(DPATH)/$(@F:.o=.d) -o $@ -c $<
$(CC) $(CFLAGS) -MMD -MF $(DPATH)/$(@F:.o=.d) -o $@ -c $<
# Don't autodelete object files:
.SECONDARY: $(OPATH)/%.o