From e6e360a87ba7b67a7d894c91a8397616892ce420 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 18 Jul 2026 22:12:32 +0200 Subject: Makefile modernisiert --- config.mk | 1 + makefile | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 config.mk diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..c718b91 --- /dev/null +++ b/config.mk @@ -0,0 +1 @@ +CPPFLAGS=-Wall -Werror -std=c++20 -pedantic -O2 diff --git a/makefile b/makefile index 7723923..c5161ac 100644 --- a/makefile +++ b/makefile @@ -1,18 +1,22 @@ .PHONY: all clean +include config.mk + BIN=bin/srcut -OBJS+=obj/srcut.o -HEADER=${wildcard include/*.hpp} +OBJS=obj/srcut.o CPPFLAGS=-Wall -Werror -std=c++20 -pedantic -Iinclude -O2 all: $(BIN) -$(BIN): $(OBJS) +$(BIN): $(OBJS) | bin c++ -o $@ $(OBJS) -obj/%.o: src/%.cpp $(HEADER) +obj/%.o: src/%.cpp | obj c++ -o $@ $(CPPFLAGS) -c $< +bin obj: + mkdir -p $@ + clean: - rm -f obj/* bin/* + rm -rf obj bin -- cgit v1.3