swh:1:snp:cae2596088bc8b92147ee77a766423472ecb4710
Tip revision: d19abc2a0d0772d39a5b257d1d4b32ca194c6ebd authored by Dirk Eddelbuettel on 10 November 2009, 10:15:12 UTC
version 0.6.8
version 0.6.8
Tip revision: d19abc2
Makevars.win
# Emacs please make this -*- mode: makefile; tab-width: 8 -*-
#
# Makefile.win for Rcpp
#
# Copyright (C) 2008 - 2009 Dirk Eddelbuettel <edd@debian.org>
#
# Contributions from an older Makefile.win are
# (C) Dominick Samperi and Uwe Ligges and gratefully acknowledged
## ask R about compiler flags and libraries
#RCPPFLAGS = `${R_HOME}/bin/R CMD config --cppflags`
#RLDFLAGS := `${R_HOME}/bin/R CMD config --ldflags`
# or just set it directly
#RCPPFLAGS = -I$(R_HOME)/include -I.
RLDFLAGS = -L$(R_HOME)/bin -lR
# or just copy defaults (cf $R_HOME/etc/Makeconf)
#RCPPFLAGS = $(ALL_CXXFLAGS)
#RLDFLAGS = $(LIBR) $(LIBM)
## and pass this on to the implicit build rules
PKG_CPPFLAGS += -I.
PKG_LIBS += -s $(RLDFLAGS)
## all sources and objects
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
## the 'user' library contains all source apart from RcppExample.o and is what
## users need for their projects -- RcppExample is used by the package library
## we place it inside the inst/ directory so that it gets installed by the package
USEROBJ = $(filter-out RcppExample.o,$(OBJECTS))
USERDIR = ../inst/lib
USERLIB = $(USERDIR)/libRcpp.a
## to filter out -Wall which generated a ton with older compilers
newCXXFLAGS := $(filter-out -Wall,$(CXXFLAGS))
CXXFLAGS := $(newCXXFLAGS)
## the 'package' library contains both Rcpp.{cpp,h} and the RcppExample used to demonstrate the package
## it is loaded via library(Rcpp) but is not used for compiling / linking against
PKGLIB = Rcpp.dll
PKGOBJ = $(OBJECTS)
RM = rm -f
.PHONY: all clean
all: $(USERLIB) $(PKGLIB)
clean:
${RM} $(PKGOBJ) $(PKGLIB)
$(PKGLIB): $(PKGOBJ)
$(CXX) -shared -o $(PKGLIB) $(PKGOBJ) $(PKG_LIBS)
$(USERLIB): $(USEROBJ)
-mkdir -p $(USERDIR) 2>/dev/null
ar r $(USERLIB) $(USEROBJ)
ranlib $(USERLIB)
cp -vax Rcp*.h $(USERDIR)