From ec45be0578fb50ad4f3df28275f01d82a6d7b518 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 18 Sep 2020 01:13:53 +0200 Subject: split matcha header into h/cc file + adapt make rules --- Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e86f7fa..ab48a9d 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,29 @@ -CXX := g++ +AS := gcc +CXX := g++ CXXFLAGS := -g -O0 -Wall -Wextra -I. +AR := ar +RANLIB := ranlib -example/test: example/test.cc lib/thread_create.s lib/matcha.h - $(CXX) -o $@ $^ $(CXXFLAGS) +lib/libmatcha.a: lib/matcha.o lib/thread_create.o lib/matcha.h + $(AR) rcs $@ $(filter %.o,$^) + $(RANLIB) $@ + +%.o: %.cc + $(CXX) -c -o $@ $^ $(CXXFLAGS) + +%.o: %.s + $(AS) -c -o $@ $^ fmt: fd --type f '.+.h$$|.+.cc$$' --exec clang-format -i {} +example/test: example/test.o lib/libmatcha.a + $(CXX) -o $@ $^ + gdb: example/test which cgdb && cgdb -x util.gdb -ex 'start' example/test \ || gdb -x util.gdb -ex 'start' example/test clean: rm -f example/test + rm -f **/*.o **/lib*.a -- cgit v1.2.3