91 lines
2.3 KiB
Plaintext
91 lines
2.3 KiB
Plaintext
# $Id: macosx.gmk,v 1.2 2006/04/25 05:50:05 kmura Exp $
|
|
# $Name: geant4-08-01 $
|
|
# ===========================================================
|
|
# System specific terms
|
|
# ===========================================================
|
|
|
|
# compile flags
|
|
CXX := g++
|
|
|
|
ifdef COMPILE_WITH_BOOST
|
|
CXXFLAGS := -fPIC -ftemplate-depth-256 -Wno-long-double
|
|
CXXFLAGS += -no-cpp-precomp -fno-inline -fcoalesce-templates
|
|
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
|
|
ifndef DEBUG
|
|
CXXFLAGS += -DNDEBUG
|
|
endif
|
|
else
|
|
CXXFLAGS := -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
|
|
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
|
|
CXXFLAGS += -fPIC
|
|
endif
|
|
|
|
ifdef COMPILE_G4PY
|
|
CXXFLAGS := -fPIC -ansi -pipe
|
|
CXXFLAGS += -ftemplate-depth-256 -Wno-long-double
|
|
CXXFLAGS += -no-cpp-precomp -fno-inline -fcoalesce-templates
|
|
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
|
|
ifndef DEBUG
|
|
CXXFLAGS += -DNDEBUG
|
|
endif
|
|
endif
|
|
|
|
# extention of shared library
|
|
soext := 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 BOOST_LIBDIR
|
|
rpath0 := $(BOOST_LIBDIR)
|
|
endif
|
|
|
|
ifdef G4PY_EXLIB_LIBDIR
|
|
rpath1 := $(G4PY_EXLIB_LIBDIR)
|
|
endif
|
|
|
|
ifdef COMPILE_G4PY
|
|
rpath2 := $(Q_G4_LIBDIR):$(Q_CLHEP_LIBDIR)
|
|
endif
|
|
|
|
#rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2)
|
|
rpathflag :=
|
|
|
|
ifdef CPPVERBOSE
|
|
define build-library
|
|
$(CXX) $(rpathflag) -bundle -flat_namespace -undefined define_a_way \
|
|
-o $@ $(foreach dir,$(SUBLIBS),$(dir)/*.o)
|
|
endef
|
|
else
|
|
define build-library
|
|
@echo Building a module $@ ...
|
|
@$(CXX) $(rpathflag) -bundle -flat_namespace -undefined define_a_way \
|
|
-o $@ $(foreach dir,$(SUBLIBS),$(dir)/*.o)
|
|
endef
|
|
endif
|
|
|
|
ifdef CPPVERBOSE
|
|
define build-module
|
|
$(CXX) $(rpathflag) -bundle -flat_namespace -undefined define_a_way \
|
|
-o $@ $(objects) $(LOPT)
|
|
endef
|
|
else
|
|
define build-module
|
|
@echo Building a module $@ ...
|
|
@$(CXX) $(rpathflag) -bundle -flat_namespace -undefined define_a_way \
|
|
-o $@ $(objects) $(LOPT)
|
|
endef
|
|
endif
|
|
|