Fixed Makfile

This commit is contained in:
Bob Polis 2023-02-09 17:04:21 +01:00
parent 152d83c863
commit ba7fdaea61

View File

@ -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