# $Id: linuxx8664gcc.gmk,v 1.9 2008/12/01 10:14:36 kmura Exp $ # $Name: geant4-09-04-beta-01 $ # =========================================================== # System specific terms # =========================================================== # compile flags CXX := g++ -m64 ifdef COMPILE_WITH_BOOST CXXFLAGS := -fPIC -ftemplate-depth-255 -finline-functions -Wno-inline CXXFLAGS += -fpermissive CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB CXXFLAGS += -O2 ifndef DEBUG CXXFLAGS += -DNDEBUG endif else CXXFLAGS := -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long CXXFLAFS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe CXXFLAGS += -fPIC CXXFLAGS += -O2 endif ifdef COMPILE_G4PY CXXFLAGS := -fPIC -ansi -pipe CXXFLAGS += -ftemplate-depth-255 -finline-functions CXXFLAGS += -fpermissive CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB CXXFLAGS += -O2 ifndef DEBUG CXXFLAGS += -DNDEBUG endif endif # extention of shared library soext := so modext := so # implicit rules %.o: %.cc ifdef CPPVERBOSE $(CXX) -c -o $@ $(CXXFLAGS) $(CPPFLAGS) $*.cc else @echo Compiling $< ... @$(CXX) -c -o $@ $(CXXFLAGS) $(CPPFLAGS) $*.cc endif %.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )' %.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )' # building a shared library ifdef Q_BOOST_LIBDIR rpath0 := $(Q_BOOST_LIBDIR) endif ifdef COMPILE_G4PY rpath1 := $(Q_G4_LIBDIR) ifneq ($(Q_CLHEP_LIBDIR), $(Q_G4_LIBDIR)) rpath2 := $(Q_CLHEP_LIBDIR) endif endif ifdef G4PY_EXLIB_LIBDIR rpath3 := $(G4PY_EXLIB_LIBDIR) endif rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2):$(rpath3) ifdef CPPVERBOSE define build-library $(CXX) $(rpathflag) -Wl,-soname,$@ -shared -o $@ $(objects) endef else define build-library @echo Building a library $@ ... @$(CXX) $(rpathflag) -Wl,-soname,$@ -shared -o $@ $(objects) endef endif ifdef CPPVERBOSE define build-module $(CXX) $(rpathflag) -Wl,-soname,$@ -shared -o $@ $(objects) $(LOPT) endef else define build-module @echo Building a module $@ ... @$(CXX) $(rpathflag) -Wl,-soname,$@ -shared -o $@ $(objects) $(LOPT) endef endif