Skip to content

Commit

Permalink
feat: add Makefile (#12)
Browse files Browse the repository at this point in the history
Resolves #12
  • Loading branch information
jimbrig committed Aug 28, 2024
1 parent 927e924 commit 252292a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^Makefile$
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PKGNAME = `sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION`
PKGVERS = `sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION`

all: check

build: install_deps
R CMD build .

check: build
R CMD check --no-manual $(PKGNAME)_$(PKGVERS).tar.gz

install_deps:
Rscript \
-e 'if (!requireNamespace("remotes")) install.packages("remotes")' \
-e 'remotes::install_deps(dependencies = TRUE)'

install: build
R CMD INSTALL $(PKGNAME)_$(PKGVERS).tar.gz

clean:
@rm -rf $(PKGNAME)_$(PKGVERS).tar.gz $(PKGNAME).Rcheck

0 comments on commit 252292a

Please sign in to comment.