Commit 31339631 authored by Kurt Van Dijck's avatar Kurt Van Dijck
Browse files

Makefile: run cleaning from TMP dir

parent 915b1c8e
......@@ -88,13 +88,16 @@ cleaning-%.R: cleaning-%.json ../libmotus/libmotusr/cleaning-prototype.R
research_%.RData: TMPDIR := $(shell mktemp -d /tmp/motus-clean-XXXXXX)
research_%.RData: cleaning-%.R .force-% research_%-raw.RData
@echo "--- $@ ---"
@echo "--- $@ --- in $(TMPDIR)"
@rm -f $(wildcard *_$*.sav)
@echo $(filter %.R,$^) > .files_$*
@cp $(filter %.R,$^) $(filter %.RData,$^) $(TMPDIR)
@cd $(TMPDIR)
@R -q --vanilla $(ROPTS) >output_$*-clean.log 2>&1 <<EOF
for (file in Sys.glob('${LIBMOTUS}/libmotusr/R/*.R'))
for (file in Sys.glob('$(abspath $(LIBMOTUS))/libmotusr/R/*.R'))
source(file, chdir=TRUE)
if (exists("diary_raw")) diary = diary_raw;
......@@ -115,6 +118,9 @@ research_%.RData: cleaning-%.R .force-% research_%-raw.RData
save_spss(get(objecttosave), paste(objecttosave,"_$*.sav",sep=""))
@cd -
@cp $(TMPDIR)/*_$**.log $(TMPDIR)/*_$*.sav $(TMPDIR)/$@ .
@rm -rf $(TMPDIR)
@$(DO_BEST_EFFORT) research_%.RData
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment