[pypy-commit] pypy cppyy-packaging: simplify Makefile (expects backend for full tests) and remove obsolete options

wlav pypy.commits at gmail.com
Thu Aug 3 20:16:24 EDT 2017


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: cppyy-packaging
Changeset: r92059:21fdf4274169
Date: 2017-08-03 14:04 -0700
http://bitbucket.org/pypy/pypy/changeset/21fdf4274169/

Log:	simplify Makefile (expects backend for full tests) and remove
	obsolete options

diff --git a/pypy/module/_cppyy/test/Makefile b/pypy/module/_cppyy/test/Makefile
--- a/pypy/module/_cppyy/test/Makefile
+++ b/pypy/module/_cppyy/test/Makefile
@@ -1,26 +1,23 @@
-dicts = example01Dict.so datatypesDict.so advancedcppDict.so advancedcpp2Dict.so \
-overloadsDict.so stltypesDict.so operatorsDict.so fragileDict.so crossingDict.so \
-iotypesDict.so
+dicts = advancedcppDict.so \
+        advancedcpp2Dict.so \
+        crossingDict.so \
+        datatypesDict.so \
+        example01Dict.so \
+        fragileDict.so \
+        operatorsDict.so \
+        overloadsDict.so \
+        stltypesDict.so
+
 all : $(dicts)
 
-ifneq (${REFLEXHOME},)
-  ROOTSYS := ${REFLEXHOME}
-else ifneq (${ROOTSYS},)
-  ROOTSYS := ${ROOTSYS}
+HASGENREFLEX:=$(shell command -v genreflex 2> /dev/null)
+
+cppflags=-std=c++11 -O3 -m64 -fPIC -rdynamic
+ifdef HASGENREFLEX
+  genreflex_flags:=$(shell genreflex --cppflags)
+  cppflags+=$(genreflex_flags)
 else
-  DUMMY := t
-endif
-
-ifeq ($(DUMMY),t)
-  cppflags=
-else
-  ifeq ($(ROOTSYS),)
-    genreflex=genreflex
-    cppflags=-pthread -std=c++11 -m64 -I./include -L./lib64 -L./lib
-  else
-    genreflex=$(ROOTSYS)/bin/genreflex
-    cppflags=$(shell $(ROOTSYS)/bin/root-config --cflags) $(shell $(ROOTSYS)/bin/root-config --ldflags) -L$(shell $(ROOTSYS)/bin/root-config --libdir) -lCore
-  endif
+  cppflags+=-DCPPYY_DUMMY_BACKEND
 endif
 
 PLATFORM := $(shell uname -s)
@@ -28,41 +25,22 @@
   cppflags+=-dynamiclib -single_module -arch x86_64 -undefined dynamic_lookup
 endif
 
-ifeq ($(DUMMY),t)
-  cppflags2=-O3 -fPIC -rdynamic -std=c++11 -DCPPYY_DUMMY_BACKEND
-else ifeq ($(CLING),t)
-  cppflags2=-O3 -fPIC -rdynamic
-else
-  ifeq ($(shell $(genreflex) --help | grep -- --with-methptrgetter),)
-    genreflexflags=
-    cppflags2=-O3 -fPIC
-  else
-    genreflexflags=--with-methptrgetter
-    cppflags2=-Wno-pmf-conversions -O3 -fPIC
-  endif
-endif
 
-ifeq ($(CLING),t)
-%Dict.so: %.h %.cxx %_cling.cxx
-	g++ -o $@ $*.cxx $*_cling.cxx -shared $(cppflags) $(cppflags2)
-
-%_cling.cxx: %.h %_LinkDef.h
-	rootcling -f $@ -rml $*Dict.so -rmf $*Dict.rootmap -c $*.h $*_LinkDef.h
-
-else ifeq ($(DUMMY),t)
+ifndef HASREFLEX
 %Dict.so: %.cxx
-	g++ -o $@ $^ -shared $(cppflags) $(cppflags2)
+	$(CXX) -shared $(cppflags) -o $@ $^
 
 else # reflex
 %Dict.so: %_rflx.cpp %.cxx
-	g++ -o $@ $^ -shared $(cppflags) $(cppflags2)
+	$(CXX) -shared $(cppflags) -o $@ $^
 
 %_rflx.cpp: %.h %.xml
-	$(genreflex) $< $(genreflexflags) --selection=$*.xml --rootmap=$*Dict.rootmap --rootmap-lib=$*Dict.so
+	genreflex $< --selection=$*.xml --rootmap=$*Dict.rootmap --rootmap-lib=$*Dict.so
 
 endif
 
 
 .PHONY: clean
+
 clean:
-	-rm -f $(dicts) $(subst .so,.rootmap,$(dicts)) $(subst Dict.so,_rflx_rdict.pcm,$(dicts)) $(subst Dict.so,_rflx.cpp,$(dicts)) $(subst Dict.so,_cling.h,$(dicts)) $(subst Dict.so,_cling.cxx,$(dicts)) $(subst Dict.so,_cling_rdict.pcm,$(dicts)) $(wildcard *.pyc)
+	-rm -f $(dicts) $(subst .so,.rootmap,$(dicts)) $(subst Dict.so,_rflx_rdict.pcm,$(dicts)) $(subst Dict.so,_rflx.cpp,$(dicts)) $(wildcard *.pyc)


More information about the pypy-commit mailing list