#-*- Makefile -*- all: libR $(DLLNAME).dll # set this in Makevars.win to supply your own resource file RCNAME=${DLLNAME}_res # set this (e.g. in SHLIB) to suppress adding version info to the DLL RCOBJ=$(RCNAME).o # Don't use SOURCES as this get passed on for libR. CFSOURCES=$(wildcard -f *.c *.f) CXXSOURCES=$(wildcard -f *.cc *.cpp *.C) OBJSA=$(foreach i,$(CFSOURCES) $(CXXSOURCES),$(basename $i).o) include $(RHOME)/src/gnuwin32/MkRules ifneq ($(strip $(CXXSOURCES)),) DLL_LDMAIN=g++ endif ifdef DEBUG DLLFLAGS= DEBUGFLAG=-g -Wall else DLLFLAGS=-s DEBUGFLAG=-Wall endif CPPFLAGS=$(PKG_CPPFLAGS) -I$(RHOME)/src/include # -include $(RHOME)/src/include/globalvar.h CFLAGS=$(CPPFLAGS) $(DEBUGFLAG) -O2 $(PKG_CFLAGS) CXXFLAGS=$(CPPFLAGS) $(DEBUGFLAG) -O2 $(PKG_CXXFLAGS) FFLAGS=-O2 $(DEBUGFLAG) DLLLIBS=-L$(RHOME)/src/gnuwin32 $(PKG_LIBS) $(FLIBS) -lR RESFLAGS=--include-dir $(RHOME)/src/include AA=$(wildcard Makefile) ifeq ($(AA),Makefile) include Makefile else OBJS=$(filter-out $(OBJS-NO),$(OBJSA)) endif AA=$(wildcard Makevars.win) ifeq ($(AA),Makevars.win) include Makevars.win else -include Makevars endif libR: @$(MAKE) --no-print-directory -C $(RHOME)/src/gnuwin32 libR.a $(DLLNAME)_res.rc: PERL5LIB=$(RHOME)/share/perl perl $(RHOME)/src/gnuwin32/makeDllRes.pl $(DLLNAME) > $@ $(DLLNAME)_res.o: $(DLLNAME)_res.rc $(RHOME)/src/include/Rversion.h $(DLLNAME).a: $(OBJS) $(RM) -f $@ $(AR) cr $@ *.o $(RANLIB) $@ $(DLLNAME).dll : $(DLLNAME).a $(RCOBJ)