File: Makevars

package info (click to toggle)
r-cran-rinside 0.2.13-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 604 kB
  • ctags: 592
  • sloc: cpp: 3,155; xml: 57; ansic: 41; makefile: 1
file content (61 lines) | stat: -rw-r--r-- 1,959 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
## -*- mode: Makefile; tab-width: 8 -*- 
##
## Copyright (C) 2010 - 2014  Dirk Eddelbuettel and Romain Francois
##
## This file is part of RInside.
##
## RInside is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 of the License, or
## (at your option) any later version.
##
## RInside is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with RInside.  If not, see <http://www.gnu.org/licenses/>.

USERLIB=libRInside$(DYLIB_EXT)
USERLIBST=libRInside.a
USERDIR=../inst/lib

ifneq ("$(wildcard /usr/bin/dpkg-buildflags)", "")
HARDEN_FLAGS=$(shell dpkg-buildflags --get LDFLAGS)
endif

PKG_CPPFLAGS = -I. -I../inst/include/
PKG_LIBS = 

all:	headers $(SHLIB) userLibrary

headers: RInsideAutoloads.h RInsideEnvVars.h

RInsideAutoloads.h:
	${R_HOME}/bin/Rscript tools/RInsideAutoloads.r > RInsideAutoloads.h

RInsideEnvVars.h:
	${R_HOME}/bin/Rscript tools/RInsideEnvVars.r   > RInsideEnvVars.h

RInside.cpp: headers

userLibrary: $(USERLIB) $(USERLIBST)
	-@if test ! -e $(USERDIR)$(R_ARCH); then mkdir -p $(USERDIR)$(R_ARCH); fi
	cp $(USERLIB) $(USERDIR)$(R_ARCH)
	cp $(USERLIBST) $(USERDIR)$(R_ARCH)
	rm $(USERLIB) $(USERLIBST)

$(USERLIB): $(OBJECTS)
	$(SHLIB_CXXLD) $(HARDEN_FLAGS) -o $(USERLIB) $^ $(SHLIB_CXXLDFLAGS) $(ALL_LIBS)
	@if test -e "/usr/bin/install_name_tool"; then /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi

$(USERLIBST): $(OBJECTS)
	$(AR) qc $(USERLIBST) $^
	@if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi

.PHONY: all clean userLibrary headers

clean:
	rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST)