From ba7fdaea61aa1cdbf822b50f8b96a94e0b1541a7 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Thu, 9 Feb 2023 17:04:21 +0100 Subject: [PATCH] Fixed Makfile --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index faa879f..1feb37f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ MANPAGE := $(BIN).$(MANSECTION) SRCS := $(notdir $(wildcard src/*.cpp)) OBJS := $(SRCS:.cpp=.o) -DEPS := $(SRCS:.cpp=.d) BUILDDIR := build/intermediates/ PREFIX ?= /usr/local @@ -42,17 +41,15 @@ all: prebuild $(OUTDIR)$(BIN) prebuild: @mkdir -p $(BUILDDIR) $(OUTDIR) -$(OUTDIR)$(BIN): $(OBJS) $(DEPS) +$(OUTDIR)$(BIN): $(OBJS) $(CXX) -o $(OUTDIR)$(BIN) $(LDFLAGS) $(LDLIBS) $(addprefix $(BUILDDIR),$(OBJS)) @ln -sf $(OUTDIR)$(BIN) $(BIN) -%.o: %.cpp %.d +%.o %.d: %.cpp $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $< @mv $@ $*.d $(BUILDDIR) --include $(BUILDDIR)*.d - -%.d: ; +-include $(BUILDDIR)$(SRCS:.cpp=.d) test: $(MAKE) -C tests && tests/tests