Skip to content

Commit

Permalink
chore: Fix auto initialization of submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoabcoelho committed Sep 13, 2023
1 parent 4c7ebb3 commit 9dbd573
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ PREMFILE = $(PREMDIR)/prem_default.txt
PREM3DFILE = $(MODEL3DDIR)/earth_binned_default.txt
PREMINC = $(CURDIR)/inc/prem_default.hpp

all: $(Eigen_INCS) $(BUILDDIRS) $(PREMINC) $(TARGET_LIB)
# Define list of submodules
SUBMODULES = $(shell grep path .gitmodules | sed 's/.*= //')
SUBMODULES := $(patsubst %,%/.git,$(SUBMODULES))

all: $(SUBMODULES) $(BUILDDIRS) $(PREMINC) $(TARGET_LIB)

$(TARGET_LIB): $(DICTIONARY) $(SOURCES) $(MATRIX)
@echo " Building $(PACKAGE)..."
Expand All @@ -56,8 +60,8 @@ $(DICTIONARY): $(HEADERS) inc/LinkDef.h
@$(DICTEXE) -f $@ $(DICTFLAGS) $(INCDIRS) $^
@if [ -e $(DICTIONARY:%.cxx=%_rdict.pcm) ] ; then mkdir -p lib && mv $(DICTIONARY:%.cxx=%_rdict.pcm) $(TARGET_PCM) ; fi # ROOT 6

$(Eigen_INCS):
@echo " Eigen not found. Trying to initialize submodule..."
$(SUBMODULES):
@echo " $@ not found. Trying to initialize submodule..."
@echo " git submodule update --init"
@git submodule update --init

Expand Down

0 comments on commit 9dbd573

Please sign in to comment.