From 8feb1db40c271c6091d1a1ecc8505da7a10b730c Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Thu, 12 Sep 2024 15:04:34 +0200 Subject: [PATCH] Replace tester Makefile with new version --- tester/Makefile | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/tester/Makefile b/tester/Makefile index db9f49a..26cb5cf 100644 --- a/tester/Makefile +++ b/tester/Makefile @@ -1,45 +1,31 @@ +LDLIBS := -lsclogging -lscterm + BIN := $(shell basename $$(pwd)) SRCS := $(wildcard *.cpp) -OBJS := $(subst .cpp,.o,$(SRCS)) -DEPS := $(subst .cpp,.d,$(SRCS)) +OBJS := $(SRCS:.cpp=.o) +DEPS := $(SRCS:.cpp=.dep) CXX ?= g++ -PKG_CONFIG ?= pkg-config -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin -DATADIR ?= $(PREFIX)/share -MANDIR ?= $(DATADIR)/man - -RM := /bin/rm -f -INSTALL := /usr/bin/install -c - -CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -g -std=c++17 +CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -Wno-unused-parameter +CXXFLAGS += -g3 -std=c++20 ifeq ($(DEBUG),1) CXXFLAGS += -D DEBUG -O0 else CXXFLAGS += -D NDEBUG -O3 endif -LDLIBS := -lm -lpthread -lsclogging -lscterm +%.o: %.cpp + $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.dep -c $< -all: $(BIN) +%.dep: ; -$(BIN): $(OBJS) $(DEPS) - $(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $(BIN) +$(BIN): $(OBJS) + $(CXX) $(LDFLAGS) -o $(BIN) $(OBJS) $(LDLIBS) -%.o: %.cpp %.d Makefile - $(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $< - --include *.d - -%.d: ; - -.PHONY: clean install +-include $(DEPS) +.PHONY: clean clean: - $(RM) $(OBJS) $(DEPS) $(BIN) - -install: $(BIN) - $(INSTALL) $(BIN) $(DESTDIR)$(BINDIR) + rm -f $(OBJS) $(DEPS) $(BIN)