[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 |
---|
[1045] | 15 | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe -Wextra |
---|
| 16 | # CXXFLAGS := -Wall -Wextra -ansi -pedantic -Wuninitialized -Winline -Wunreachable-code |
---|
[472] | 17 | ifdef G4OPTIMISE |
---|
[1045] | 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 |
---|
[689] | 33 | FC := gfortran |
---|
[472] | 34 | FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore |
---|
| 35 | LDFLAGS += -bind_at_load |
---|
| 36 | FCLIBS := -lg2c -lnsl |
---|
| 37 | SHEXT := dylib |
---|
| 38 | ifndef X11FLAGS |
---|
| 39 | X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 |
---|
| 40 | endif |
---|
| 41 | ifndef X11LIBS |
---|
| 42 | X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE |
---|
| 43 | endif |
---|
| 44 | ifndef XMFLAGS |
---|
| 45 | XMFLAGS := -I/sw/include |
---|
| 46 | # XMFLAGS := -I/usr/X11R6/include ##### some installations. |
---|
| 47 | endif |
---|
| 48 | ifndef XMLIBS |
---|
| 49 | XMLIBS := -L/sw/lib -lXm -lXpm |
---|
| 50 | # XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations. |
---|
| 51 | endif |
---|
| 52 | ifndef XAWFLAGS |
---|
| 53 | XAWFLAGS := -I/sw/include |
---|
| 54 | # XAWFLAGS := -I/usr/X11R6/include ##### some installations. |
---|
| 55 | endif |
---|
| 56 | ifndef XAWLIBS |
---|
| 57 | XAWLIBS := -lXaw |
---|
| 58 | endif |
---|
| 59 | DLDLIBS := -ldl |
---|
| 60 | ifndef OGLHOME |
---|
| 61 | OGLHOME := /usr/X11R6 |
---|
| 62 | endif |
---|
| 63 | ifndef OGLFLAGS |
---|
| 64 | OGLFLAGS := -I$(OGLHOME)/include |
---|
| 65 | endif |
---|
| 66 | ifndef OGLLIBS |
---|
[886] | 67 | ifeq ($(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/'),9) |
---|
| 68 | # the following lines are for building on MacOSX 10.5 "Leopard" |
---|
[921] | 69 | 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] | 70 | else |
---|
| 71 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL |
---|
| 72 | endif |
---|
[472] | 73 | endif |
---|
[893] | 74 | |
---|
| 75 | # ---- QT Setup block ------------------------------------------------------- |
---|
[758] | 76 | ifndef QTHOME |
---|
[868] | 77 | QTHOME := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo "/Library/Frameworks" || echo "/sw") |
---|
[758] | 78 | endif |
---|
[875] | 79 | ifndef QTMOC |
---|
| 80 | ifeq ($(QTHOME),/Library/Frameworks) |
---|
| 81 | QTMOC := /usr/bin/moc |
---|
| 82 | else |
---|
| 83 | QTMOC := $(QTHOME)/bin/moc |
---|
| 84 | endif |
---|
[868] | 85 | endif |
---|
[865] | 86 | |
---|
[875] | 87 | QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' ) |
---|
| 88 | |
---|
[758] | 89 | ifndef QTFLAGS |
---|
[868] | 90 | ifeq ($(QT_VERSION),4) |
---|
| 91 | QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers |
---|
| 92 | QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers |
---|
[1017] | 93 | QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers |
---|
[865] | 94 | else |
---|
[868] | 95 | QTFLAGS := -I $(QTHOME)/include/Qt -I$(QTHOME)/include |
---|
[865] | 96 | endif |
---|
[758] | 97 | endif |
---|
[868] | 98 | ifndef QTLIBPATH |
---|
| 99 | ifeq ($(QT_VERSION),3) |
---|
[1017] | 100 | QTLIBPATH := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "$(QTHOME)/lib/qt3/lib" || echo "$(QTHOME)/lib" ) |
---|
[868] | 101 | else |
---|
| 102 | QTLIBPATH := -F$(QTHOME) |
---|
| 103 | endif |
---|
| 104 | endif |
---|
[758] | 105 | ifndef QTLIBS |
---|
[868] | 106 | ifeq ($(QT_VERSION),3) |
---|
[1017] | 107 | QTLIBS := -L$(QTLIBPATH) |
---|
| 108 | QT3_MT := $(shell ls $(QTLIBPATH)/libqt-mt.* 2>/dev/null | wc -l ) |
---|
[868] | 109 | ifneq ($(QT3_MT),0) |
---|
| 110 | QTLIBS += -lqt-mt |
---|
| 111 | else |
---|
| 112 | QTLIBS += -lqt |
---|
| 113 | endif |
---|
| 114 | QTLIBS += -lqui |
---|
[865] | 115 | else |
---|
[1017] | 116 | QTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui |
---|
[865] | 117 | endif |
---|
[766] | 118 | endif |
---|
| 119 | ifndef GLQTLIBS |
---|
[868] | 120 | ifeq ($(QT_VERSION),3) |
---|
| 121 | # already done in QTLIBS |
---|
| 122 | # GLQTLIBS := $(QTLIBS) |
---|
[865] | 123 | else |
---|
[1017] | 124 | GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui |
---|
[868] | 125 | GLQTLIBS += -framework QtOpenGL |
---|
[865] | 126 | endif |
---|
[758] | 127 | endif |
---|
[893] | 128 | #---------------------------------------------------------------------------- |
---|
[472] | 129 | |
---|
| 130 | define build-granular-shared-lib |
---|
[1017] | 131 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
[472] | 132 | cd $(G4TMPDIR); \ |
---|
[921] | 133 | $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \ |
---|
[472] | 134 | -o $$libdir/$(@F) $(INTYLIBS) *.o |
---|
| 135 | endef |
---|
| 136 | define build-global-shared-lib |
---|
| 137 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
| 138 | cd $(G4TMP)/$(G4SYSTEM); \ |
---|
[921] | 139 | $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \ |
---|
[472] | 140 | -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o); |
---|
| 141 | endef |
---|
| 142 | |
---|
| 143 | endif |
---|