diff --git a/Makefile b/Makefile index 7a4a7d4..3896861 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ TARGET := fastp BIN_TARGET := ${TARGET} CXX ?= g++ -CXXFLAGS := -std=c++11 -pthread -g -O3 -I${DIR_INC} $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir)) ${CXXFLAGS} +CXXFLAGS := -std=c++11 -pthread -g -O3 -MD -MP -I${DIR_INC} $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir)) ${CXXFLAGS} LIBS := -lisal -ldeflate -lpthread STATIC_FLAGS := -static -Wl,--no-as-needed -pthread LD_FLAGS := $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(LIBS) $(LD_FLAGS) @@ -35,15 +35,11 @@ ${DIR_OBJ}/%.o:${DIR_SRC}/%.cpp .PHONY:clean .PHONY:static clean: - @if test -d $(DIR_OBJ) ; \ - then \ - find $(DIR_OBJ) -name *.o -delete; \ - fi - @if test -e $(TARGET) ; \ - then \ - rm $(TARGET) ; \ - fi + @rm -rf $(DIR_OBJ) + @rm -f $(TARGET) install: install $(TARGET) $(BINDIR)/$(TARGET) @echo "Installed." + +-include $(OBJ:.o=.d)