diff options
| -rw-r--r-- | config.mk | 1 | ||||
| -rw-r--r-- | makefile | 14 |
2 files changed, 10 insertions, 5 deletions
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 | |||
| @@ -1,18 +1,22 @@ | |||
| 1 | .PHONY: all clean | 1 | .PHONY: all clean |
| 2 | 2 | ||
| 3 | include config.mk | ||
| 4 | |||
| 3 | BIN=bin/srcut | 5 | BIN=bin/srcut |
| 4 | OBJS+=obj/srcut.o | 6 | OBJS=obj/srcut.o |
| 5 | HEADER=${wildcard include/*.hpp} | ||
| 6 | 7 | ||
| 7 | CPPFLAGS=-Wall -Werror -std=c++20 -pedantic -Iinclude -O2 | 8 | CPPFLAGS=-Wall -Werror -std=c++20 -pedantic -Iinclude -O2 |
| 8 | 9 | ||
| 9 | all: $(BIN) | 10 | all: $(BIN) |
| 10 | 11 | ||
| 11 | $(BIN): $(OBJS) | 12 | $(BIN): $(OBJS) | bin |
| 12 | c++ -o $@ $(OBJS) | 13 | c++ -o $@ $(OBJS) |
| 13 | 14 | ||
| 14 | obj/%.o: src/%.cpp $(HEADER) | 15 | obj/%.o: src/%.cpp | obj |
| 15 | c++ -o $@ $(CPPFLAGS) -c $< | 16 | c++ -o $@ $(CPPFLAGS) -c $< |
| 16 | 17 | ||
| 18 | bin obj: | ||
| 19 | mkdir -p $@ | ||
| 20 | |||
| 17 | clean: | 21 | clean: |
| 18 | rm -f obj/* bin/* | 22 | rm -rf obj bin |
