[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 |
---|
| 15 | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe |
---|
| 16 | ifdef G4OPTIMISE |
---|
| 17 | CXXFLAGS += -O2 |
---|
| 18 | FCFLAGS := -O2 |
---|
| 19 | CCFLAGS := -O2 |
---|
| 20 | else |
---|
| 21 | ifdef G4DEBUG |
---|
| 22 | CXXFLAGS += -g |
---|
| 23 | FCFLAGS := -g |
---|
| 24 | CCFLAGS := -g |
---|
| 25 | endif |
---|
| 26 | endif |
---|
| 27 | ifdef G4PROFILE |
---|
| 28 | CXXFLAGS += -pg |
---|
| 29 | FCFLAGS += -pg |
---|
| 30 | CCFLAGS += -pg |
---|
| 31 | endif |
---|
[689] | 32 | FC := gfortran |
---|
[472] | 33 | FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore |
---|
| 34 | LDFLAGS += -bind_at_load |
---|
| 35 | FCLIBS := -lg2c -lnsl |
---|
| 36 | SHEXT := dylib |
---|
| 37 | ifndef X11FLAGS |
---|
| 38 | X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 |
---|
| 39 | endif |
---|
| 40 | ifndef X11LIBS |
---|
| 41 | X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE |
---|
| 42 | endif |
---|
| 43 | ifndef XMFLAGS |
---|
| 44 | XMFLAGS := -I/sw/include |
---|
| 45 | # XMFLAGS := -I/usr/X11R6/include ##### some installations. |
---|
| 46 | endif |
---|
| 47 | ifndef XMLIBS |
---|
| 48 | XMLIBS := -L/sw/lib -lXm -lXpm |
---|
| 49 | # XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations. |
---|
| 50 | endif |
---|
| 51 | ifndef XAWFLAGS |
---|
| 52 | XAWFLAGS := -I/sw/include |
---|
| 53 | # XAWFLAGS := -I/usr/X11R6/include ##### some installations. |
---|
| 54 | endif |
---|
| 55 | ifndef XAWLIBS |
---|
| 56 | XAWLIBS := -lXaw |
---|
| 57 | endif |
---|
| 58 | DLDLIBS := -ldl |
---|
| 59 | ifndef OGLHOME |
---|
| 60 | OGLHOME := /usr/X11R6 |
---|
| 61 | endif |
---|
| 62 | ifndef OGLFLAGS |
---|
| 63 | OGLFLAGS := -I$(OGLHOME)/include |
---|
| 64 | endif |
---|
| 65 | ifndef OGLLIBS |
---|
[886] | 66 | ifeq ($(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/'),9) |
---|
| 67 | # the following lines are for building on MacOSX 10.5 "Leopard" |
---|
[921] | 68 | 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] | 69 | else |
---|
| 70 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL |
---|
| 71 | endif |
---|
[472] | 72 | endif |
---|
[893] | 73 | |
---|
| 74 | # ---- QT Setup block ------------------------------------------------------- |
---|
[758] | 75 | ifndef QTHOME |
---|
[868] | 76 | QTHOME := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo "/Library/Frameworks" || echo "/sw") |
---|
[758] | 77 | endif |
---|
[875] | 78 | ifndef QTMOC |
---|
| 79 | ifeq ($(QTHOME),/Library/Frameworks) |
---|
| 80 | QTMOC := /usr/bin/moc |
---|
| 81 | else |
---|
| 82 | QTMOC := $(QTHOME)/bin/moc |
---|
| 83 | endif |
---|
[868] | 84 | endif |
---|
[865] | 85 | |
---|
[875] | 86 | QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' ) |
---|
| 87 | |
---|
[758] | 88 | ifndef QTFLAGS |
---|
[868] | 89 | ifeq ($(QT_VERSION),4) |
---|
| 90 | QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers |
---|
| 91 | QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers |
---|
| 92 | QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers |
---|
[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) |
---|
| 99 | QTLIBPATH := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "/lib/qt3/lib" || echo "/lib" ) |
---|
| 100 | else |
---|
| 101 | QTLIBPATH := -F$(QTHOME) |
---|
| 102 | endif |
---|
| 103 | endif |
---|
[758] | 104 | ifndef QTLIBS |
---|
[868] | 105 | ifeq ($(QT_VERSION),3) |
---|
| 106 | QTLIBS := -L$(QTHOME)$(QTLIBPATH) |
---|
[921] | 107 | QT3_MT := $(shell ls $(QTHOME)$(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 |
---|
[868] | 115 | QTLIBS := -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 |
---|
| 123 | GLQTLIBS := -F$(QTHOME) -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 |
---|
[921] | 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 |
---|