| [472] | 1 | #
|
|---|
| 2 | # ------ MacOS-X ------
|
|---|
| 3 | # MacOS 10.3 gcc-3.3
|
|---|
| 4 | # MacOS 10.4 gcc-4.0
|
|---|
| [875] | 5 | # MacOS 10.5 gcc-4.0
|
|---|
| [472] | 6 | #
|
|---|
| 7 | # Original author: Helmut Burkhardt - CERN
|
|---|
| 8 | # Revisions: Guy Barrand - LAL
|
|---|
| 9 | # Gabriele Cosmo - CERN
|
|---|
| [875] | 10 | # Laurent Garnier - LAL
|
|---|
| [472] | 11 | #
|
|---|
| 12 | ifeq ($(G4SYSTEM),Darwin-g++)
|
|---|
| 13 | CXX := g++
|
|---|
| 14 | CXXFLAGS := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
|
|---|
| [1185] | 15 | # CXXFLAGS += -Wunused-parameter -Winline -Wunreachable-code
|
|---|
| 16 | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
|
|---|
| [472] | 17 | ifdef G4OPTIMISE
|
|---|
| [1185] | 18 | CXXFLAGS += -O2
|
|---|
| 19 | FCFLAGS := -O2
|
|---|
| 20 | CCFLAGS := -O2
|
|---|
| [472] | 21 | else
|
|---|
| 22 | ifdef G4DEBUG
|
|---|
| 23 | CXXFLAGS += -g
|
|---|
| 24 | FCFLAGS := -g
|
|---|
| 25 | CCFLAGS := -g
|
|---|
| 26 | endif
|
|---|
| 27 | endif
|
|---|
| 28 | ifdef G4PROFILE
|
|---|
| 29 | CXXFLAGS += -pg
|
|---|
| 30 | FCFLAGS += -pg
|
|---|
| 31 | CCFLAGS += -pg
|
|---|
| 32 | endif
|
|---|
| [1185] | 33 | ifdef G4OPTDEBUG
|
|---|
| 34 | CXXFLAGS += -O2 -g
|
|---|
| 35 | FCFLAGS += -O2 -g
|
|---|
| 36 | CCFLAGS += -O2 -g
|
|---|
| 37 | endif
|
|---|
| [689] | 38 | FC := gfortran
|
|---|
| [472] | 39 | FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
|
|---|
| [1185] | 40 | LDFLAGS += -bind_at_load -arch_multiple
|
|---|
| [472] | 41 | FCLIBS := -lg2c -lnsl
|
|---|
| 42 | SHEXT := dylib
|
|---|
| 43 | ifndef X11FLAGS
|
|---|
| 44 | X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
|
|---|
| 45 | endif
|
|---|
| 46 | ifndef X11LIBS
|
|---|
| 47 | X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
|
|---|
| 48 | endif
|
|---|
| 49 | ifndef XMFLAGS
|
|---|
| 50 | XMFLAGS := -I/sw/include
|
|---|
| 51 | # XMFLAGS := -I/usr/X11R6/include ##### some installations.
|
|---|
| 52 | endif
|
|---|
| 53 | ifndef XMLIBS
|
|---|
| 54 | XMLIBS := -L/sw/lib -lXm -lXpm
|
|---|
| 55 | # XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations.
|
|---|
| 56 | endif
|
|---|
| 57 | DLDLIBS := -ldl
|
|---|
| 58 | ifndef OGLHOME
|
|---|
| 59 | OGLHOME := /usr/X11R6
|
|---|
| 60 | endif
|
|---|
| 61 | ifndef OGLFLAGS
|
|---|
| 62 | OGLFLAGS := -I$(OGLHOME)/include
|
|---|
| 63 | endif
|
|---|
| 64 | ifndef OGLLIBS
|
|---|
| [886] | 65 | ifeq ($(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/'),9)
|
|---|
| 66 | # the following lines are for building on MacOSX 10.5 "Leopard"
|
|---|
| [921] | 67 | OGLLIBS := $(shell test -f /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib && echo "-L/usr/X11R6/lib -lGLU -lGL -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
|
|---|
| [886] | 68 | else
|
|---|
| 69 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
|
|---|
| 70 | endif
|
|---|
| [472] | 71 | endif
|
|---|
| [893] | 72 |
|
|---|
| 73 | # ---- QT Setup block -------------------------------------------------------
|
|---|
| [758] | 74 | ifndef QTHOME
|
|---|
| [868] | 75 | QTHOME := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo "/Library/Frameworks" || echo "/sw")
|
|---|
| [758] | 76 | endif
|
|---|
| [875] | 77 | ifndef QTMOC
|
|---|
| 78 | ifeq ($(QTHOME),/Library/Frameworks)
|
|---|
| 79 | QTMOC := /usr/bin/moc
|
|---|
| 80 | else
|
|---|
| 81 | QTMOC := $(QTHOME)/bin/moc
|
|---|
| 82 | endif
|
|---|
| [868] | 83 | endif
|
|---|
| [865] | 84 |
|
|---|
| [875] | 85 | QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
|
|---|
| 86 |
|
|---|
| [758] | 87 | ifndef QTFLAGS
|
|---|
| [868] | 88 | ifeq ($(QT_VERSION),4)
|
|---|
| 89 | QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers
|
|---|
| 90 | QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers
|
|---|
| [1017] | 91 | QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers
|
|---|
| [1185] | 92 | QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
|
|---|
| [865] | 93 | else
|
|---|
| [868] | 94 | QTFLAGS := -I $(QTHOME)/include/Qt -I$(QTHOME)/include
|
|---|
| [865] | 95 | endif
|
|---|
| [758] | 96 | endif
|
|---|
| [868] | 97 | ifndef QTLIBPATH
|
|---|
| 98 | ifeq ($(QT_VERSION),3)
|
|---|
| [1017] | 99 | QTLIBPATH := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "$(QTHOME)/lib/qt3/lib" || echo "$(QTHOME)/lib" )
|
|---|
| [868] | 100 | else
|
|---|
| [1185] | 101 | QTLIBPATH := -F$(QTHOME)/lib -F$(QTHOME)
|
|---|
| [868] | 102 | endif
|
|---|
| 103 | endif
|
|---|
| [758] | 104 | ifndef QTLIBS
|
|---|
| [868] | 105 | ifeq ($(QT_VERSION),3)
|
|---|
| [1017] | 106 | QTLIBS := -L$(QTLIBPATH)
|
|---|
| 107 | QT3_MT := $(shell ls $(QTLIBPATH)/libqt-mt.* 2>/dev/null | wc -l )
|
|---|
| [868] | 108 | ifneq ($(QT3_MT),0)
|
|---|
| 109 | QTLIBS += -lqt-mt
|
|---|
| 110 | else
|
|---|
| 111 | QTLIBS += -lqt
|
|---|
| 112 | endif
|
|---|
| 113 | QTLIBS += -lqui
|
|---|
| [865] | 114 | else
|
|---|
| [1017] | 115 | QTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
|
|---|
| [865] | 116 | endif
|
|---|
| [766] | 117 | endif
|
|---|
| 118 | ifndef GLQTLIBS
|
|---|
| [868] | 119 | ifeq ($(QT_VERSION),3)
|
|---|
| 120 | # already done in QTLIBS
|
|---|
| 121 | # GLQTLIBS := $(QTLIBS)
|
|---|
| [865] | 122 | else
|
|---|
| [1017] | 123 | GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
|
|---|
| [868] | 124 | GLQTLIBS += -framework QtOpenGL
|
|---|
| [865] | 125 | endif
|
|---|
| [758] | 126 | endif
|
|---|
| [893] | 127 | #----------------------------------------------------------------------------
|
|---|
| [472] | 128 |
|
|---|
| 129 | define build-granular-shared-lib
|
|---|
| [1017] | 130 | @libdir=`(cd $(@D);/bin/pwd)`; \
|
|---|
| [472] | 131 | cd $(G4TMPDIR); \
|
|---|
| [921] | 132 | $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \
|
|---|
| [472] | 133 | -o $$libdir/$(@F) $(INTYLIBS) *.o
|
|---|
| 134 | endef
|
|---|
| 135 | define build-global-shared-lib
|
|---|
| 136 | @libdir=`(cd $(@D);/bin/pwd)`; \
|
|---|
| 137 | cd $(G4TMP)/$(G4SYSTEM); \
|
|---|
| [921] | 138 | $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \
|
|---|
| [472] | 139 | -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
|
|---|
| 140 | endef
|
|---|
| 141 |
|
|---|
| 142 | endif
|
|---|