Skip to content

Commit

Permalink
recursive targets + add deps for prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Feb 18, 2022
1 parent 00744e8 commit 3479784
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ RSCRIPTS_NO_T = $(filter-out $(RSCRIPTS_T),$(RSCRIPTS))

DEPS=$(shell ./dependencies.sh)
R_PKG=modules,$(shell Rscript -e 'cat(sub("package:", "", grep("^package:", search(), value=TRUE)), sep=",")')
Rscript = Rscript --default-packages=$(R_PKG)
Rscript = Rscript --no-save --no-restore --slave --default-packages=$(R_PKG)

.PHONY: test install-deps prepare
.PHONY: prepare test install-deps

define \n


endef

prepare:
make -C stats nmf_mu.so
prepare::
@$(foreach DIR,$(MDIRS),make -C $(DIR) prepare$(\n))

test:
test::
@$(foreach DIR,$(MDIRS),make -C $(DIR) test$(\n))
$(if $(RSCRIPTS_NO_T), @echo "*** NO TESTS FOUND FOR: $(RSCRIPTS_NO_T) ***", )
@$(foreach R,$(RSCRIPTS_T),echo $(R); $(Rscript) $(R)$(\n))
Expand Down
2 changes: 2 additions & 0 deletions stats/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ OBJ = $(SOURCE:%.c=%.o)

.INTERMEDIATE: $(OBJ)

prepare:: nmf_mu.so

nmf_mu.so: nmf_mu.o
$(CC) -shared -Wl,-soname,$@ $(LIBS) -o $@ $^

Expand Down

0 comments on commit 3479784

Please sign in to comment.