Files
geant4/environments/g4py/config/sys/macosx.gmk
T
2016-06-09 15:37:50 +02:00

90 lines
2.2 KiB
Plaintext

# $Id: macosx.gmk,v 1.4 2006/08/10 08:49:08 kmura Exp $
# $Name: geant4-09-01 $
# ===========================================================
# System specific terms
#
# MacOSX 10.4 (Tiger) gcc 4.0.1
# Note: gc-3.3 is not valid for this setup.
# ===========================================================
# compile flags
CXX := g++
ifdef COMPILE_WITH_BOOST
CXXFLAGS := -ftemplate-depth-256 -Wno-long-double
CXXFLAGS += -no-cpp-precomp -finline-functions -Wno-inline
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
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 += -O2
endif
ifdef COMPILE_G4PY
CXXFLAGS := -ansi -pipe
CXXFLAGS += -ftemplate-depth-256 -Wno-long-double
CXXFLAGS += -no-cpp-precomp -finline-functions -Wno-inline
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
ifndef DEBUG
CXXFLAGS += -DNDEBUG
endif
endif
# extention of shared library
soext := dylib
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 LOCALLIB
install_path := $(PWD)
else
install_path := $(Q_LIBDIR)
endif
ifdef CPPVERBOSE
define build-library
$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
-o $@ -install_name $(install_path)/$@ $(objects)
endef
else
define build-library
@echo Building a module $@ ...
@$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \
-o $@ -install_name $(install_path)/$@ $(objects)
endef
endif
# building a module
ifdef CPPVERBOSE
define build-module
$(CXX) -Wl,-x -bundle -flat_namespace -dead_strip \
-o $@ $(objects) $(LOPT)
endef
else
define build-module
@echo Building a module $@ ...
@$(CXX) -Wl,-x -bundle -flat_namespace -dead_strip \
-o $@ $(objects) $(LOPT)
endef
endif