-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 871 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (28 loc) · 871 Bytes
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
# Makefile for iaw R package
PKGNAME := iaw
VERSION := $(shell sed -n 's/^Version: *//p' DESCRIPTION)
# All library .R files (excluding Rprofile.R)
LIB_SOURCES := $(filter-out Rprofile.R, $(wildcard *.R))
.PHONY: lib man build check install clean
## Populate inst/lib/ with copies of library .R files
lib: $(LIB_SOURCES)
@mkdir -p inst/lib
@cp -f $(LIB_SOURCES) inst/lib/
@echo "Copied $(words $(LIB_SOURCES)) files to inst/lib/"
## Generate man pages from roxygen-style comments
man: $(LIB_SOURCES) tools/generate-man.R
@Rscript --no-init-file tools/generate-man.R
## Build the package tarball
build: lib man
R CMD build .
## Run R CMD check
check: build
R CMD check $(PKGNAME)_$(VERSION).tar.gz
## Install the package
install: lib man
R CMD INSTALL .
## Clean build artifacts
clean:
rm -rf inst/lib
rm -rf $(PKGNAME).Rcheck
rm -f $(PKGNAME)_*.tar.gz