diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-09-18 01:13:53 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-09-18 01:13:53 +0200 |
commit | ec45be0578fb50ad4f3df28275f01d82a6d7b518 (patch) | |
tree | 2dada348d0ea71793a6fa76b2232e7c7bce8bc58 /Makefile | |
parent | 61ba2dc2a41cd4a2148f5647c142f53e7f9a1cc7 (diff) | |
download | matcha-threads-ec45be0578fb50ad4f3df28275f01d82a6d7b518.tar.gz matcha-threads-ec45be0578fb50ad4f3df28275f01d82a6d7b518.zip |
split matcha header into h/cc file + adapt make rules
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -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 |