From 5536436532612209a6cdd919516d14769fc51afa Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 13 Feb 2019 23:35:31 +0100 Subject: Automatically init submodules in makefile --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1d3addf..c8bca05 100644 --- a/Makefile +++ b/Makefile @@ -22,14 +22,20 @@ $(TARGET): $(OBJ_FILES) termio/libtermio.a @echo LD $@ @$(CXX) $(CXXFLAGS) -o $@ $^ termio/libtermio.a $(LDFLAGS) -$(OBJDIR)/%.o: %.cpp +$(OBJDIR)/%.o: %.cpp termio/libtermio.a @mkdir -p $(dir $@) @echo CXX $< @$(CXX) $(CXXFLAGS) -c -o $@ $< -$(OBJDIR)/%.d: %.cpp +$(OBJDIR)/%.d: %.cpp termio/libtermio.a @mkdir -p $(dir $@) @echo DEP $< @$(CXX) -MT $(OBJDIR)/$*.o -MM $(CXXFLAGS) $< >$@ +termio/.git: + git submodule update --init + +termio/libtermio.a: termio/.git $(wildcard termio/*.c termio/*.h) + make -C termio + -include $(DEP_FILES) -- cgit v1.2.3-54-g00ecf