-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (28 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
R=R
PACKAGE= growmod
VERSION := $(shell sed -n '/^Version: /s///p' growmod/DESCRIPTION)
TARBALL := $(PACKAGE)_$(VERSION).tar.gz
ZIPFILE := =$(PACKAGE)_$(VERSION).zip
CPP_SRC := $(PACKAGE)/src/*.cpp
all:
make doc-update
make build-package
make install
doc-update: $(PACKAGE)/R/*.R
echo "library(roxygen2);roxygenize(\"$(PACKAGE)\",roclets = c(\"collate\", \"rd\"))" | $(R) --slave
@touch doc-update
namespace-update :: $(PACKAGE)/NAMESPACE
$(PACKAGE)/NAMESPACE: $(PACKAGE)/R/*.R
echo "library(roxygen2);roxygenize(\"$(PACKAGE)\",roclets = c(\"namespace\"))" | $(R) --slave
build-package: $(TARBALL)
$(TARBALL): $(PACKAGE)/NAMESPACE $(CPP_SRC)
$(R) CMD build --resave-data=no $(PACKAGE)
install: $(TARBALL)
$(R) CMD INSTALL --preclean $<
@touch $@
quick-install: $(PACKAGE)/src/growmod.so
$(R) CMD INSTALL $(PACKAGE)
$(PACKAGE)/src/growmod.so: $(PACKAGE)/src/growmod.cpp
cd $(PACKAGE)/src; echo "library(TMB); compile('growmod.cpp')" | R --slave
clean:
\rm -f install doc-update