76 lines
2.2 KiB
Plaintext
76 lines
2.2 KiB
Plaintext
#
|
|
# ------ MacOS-X ------ !!! not generally supported !!!
|
|
#
|
|
# MacOS 10.1 GNU-gcc 2.92.2
|
|
# MacOS 10.2 there is g++2 and g++3, choose consistently one,
|
|
# like g++2 which is 2.95.2, g++3 for 3.X.
|
|
# MacOS 10.3 use default MacOS-X compiler (g++) as the default.
|
|
# Have commands to build the .dylib (MacOS-X shared libs)
|
|
#
|
|
# Use echo -n (there is not the 'echo -e' option of Linux)
|
|
#
|
|
# Author: Helmut Burkhardt - CERN
|
|
#
|
|
ifeq ($(G4SYSTEM),Darwin-g++)
|
|
# choice of compiler (take, as default, the MacOS default) :
|
|
# CXX := g++2
|
|
# CXX := g++3
|
|
CXX := g++
|
|
CXXFLAGS := -Wall -ansi -pedantic -pipe
|
|
# optionally add verbose flag
|
|
# CXXFLAGS += -v
|
|
ifdef G4OPTIMISE
|
|
CXXFLAGS += -O
|
|
FCFLAGS := -O
|
|
CCFLAGS := -O
|
|
else
|
|
ifdef G4DEBUG
|
|
CXXFLAGS += -g
|
|
FCFLAGS := -g
|
|
CCFLAGS := -g
|
|
endif
|
|
endif
|
|
ifdef G4PROFILE
|
|
CXXFLAGS += -pg
|
|
FCFLAGS += -pg
|
|
CCFLAGS += -pg
|
|
endif
|
|
FC := g77
|
|
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
|
|
FCLIBS := -lg2c -lnsl
|
|
ECHO := /bin/echo -n
|
|
SHEXT := dylib
|
|
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
|
|
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
|
|
XMFLAGS := -I/sw/include
|
|
XMLIBS := -L/sw/lib -lXm -lXpm
|
|
DLDLIBS := -ldl
|
|
ifndef OGLHOME
|
|
OGLHOME := /usr/X11R6
|
|
endif
|
|
ifndef OGLFLAGS
|
|
OGLFLAGS := -I$(OGLHOME)/include
|
|
endif
|
|
ifndef OGLLIBS
|
|
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
|
|
endif
|
|
define build-granular-shared-lib
|
|
@libdir=`(cd $(@D);/bin/pwd)`; \
|
|
cd $(G4TMPDIR); \
|
|
g++ -dynamiclib -twolevel_namespace -undefined error -dynamic \
|
|
-single_module -o $$libdir/$(@F) *.o -L$(G4LIB)/$(G4SYSTEM) \
|
|
$(patsubst lib%,-l%,$(patsubst %.lib,%,$(GLOBLIBS))) \
|
|
-L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) $(INTYLIBS)
|
|
endef
|
|
define build-global-shared-lib
|
|
@libdir=`(cd $(@D);/bin/pwd)`; \
|
|
cd $(G4TMP)/$(G4SYSTEM); \
|
|
g++ -dynamiclib -twolevel_namespace -undefined error -dynamic \
|
|
-single_module -o $$libdir/$(@F) \
|
|
$(foreach dir,$(SUBLIBS),$(dir)/*.o) -L$(G4LIB)/$(G4SYSTEM) \
|
|
$(patsubst lib%,-l%,$(patsubst %.lib,%,$(GLOBLIBS))) \
|
|
-L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) $(INTYLIBS);
|
|
endef
|
|
|
|
endif
|