diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-10-04 10:49:20 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-10-04 10:49:20 +0200 |
commit | 4f69e91b44b4ae80b90aa25ce1114ed338923fd4 (patch) | |
tree | 6d1c51ce9c9970b531761cc3277cd1e371d4b63a | |
parent | 27f66dfd4f0de8623656f38bebcccd91cdc4f182 (diff) | |
download | matcha-threads-4f69e91b44b4ae80b90aa25ce1114ed338923fd4.tar.gz matcha-threads-4f69e91b44b4ae80b90aa25ce1114ed338923fd4.zip |
add dependecy generation
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | lib/Makefile | 22 |
2 files changed, 14 insertions, 9 deletions
@@ -1,4 +1,5 @@ *.o +*.d *.a demo1 diff --git a/lib/Makefile b/lib/Makefile index c880346..24fe7bd 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -10,21 +10,25 @@ AS := $(PREFIX)gcc ASFLAGS := -g -O0 CXX := $(PREFIX)g++ CXXFLAGS := -g -O0 -Wall -Wextra -I. +DEPS_GEN := -MMD AR := $(PREFIX)ar -libmatcha.a: thread.o executor.o \ - thread.h executor.h \ - arch/$(ARCH)/thread_create.o arch/$(ARCH)/yield.o \ - arch/$(ARCH)/init_stack.o \ - arch/$(ARCH)/api.h - $(AR) rcs $@ $(filter %.o,$^) +OBJS := thread.o executor.o +OBJS += arch/$(ARCH)/thread_create.o arch/$(ARCH)/yield.o arch/$(ARCH)/init_stack.o + +DEPS := $(OBJS:%.o=%.d) + +libmatcha.a: $(OBJS) + $(AR) rcs $@ $^ %.o: %.cc - $(CXX) -c -o $@ $^ $(CXXFLAGS) + $(CXX) -c -o $@ $(CXXFLAGS) $(DEPS_GEN) $< %.o: %.s - $(AS) -c -o $@ $^ $(ASFLAGS) + $(AS) -c -o $@ $(ASFLAGS) $< clean: - find . -name '*.o' -exec rm -f {} \; + rm -f $(OBJS) $(DEPS) rm -f libmatcha.a + +-include $(DEPS) |