1 | # |
---|
2 | # ------ MacOS-X ------ |
---|
3 | # MacOS 10.3 gcc-3.3 |
---|
4 | # MacOS 10.4 gcc-4.0 |
---|
5 | # MacOS 10.5 gcc-4.0 |
---|
6 | # |
---|
7 | # Original author: Helmut Burkhardt - CERN |
---|
8 | # Revisions: Guy Barrand - LAL |
---|
9 | # Gabriele Cosmo - CERN |
---|
10 | # Laurent Garnier - LAL |
---|
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 |
---|
32 | FC := gfortran |
---|
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 |
---|
66 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL |
---|
67 | ifeq ($(G4SYSTEM),Darwin-g++) |
---|
68 | # the following lines are for building on MacOSX 10.5 "Leopard" |
---|
69 | OGLLIBS := $(shell test -f /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib && echo " -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib") |
---|
70 | endif |
---|
71 | endif |
---|
72 | ifndef QTHOME |
---|
73 | QTHOME := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo "/Library/Frameworks" || echo "/sw") |
---|
74 | endif |
---|
75 | |
---|
76 | ifndef QTMOC |
---|
77 | ifeq ($(QTHOME),/Library/Frameworks) |
---|
78 | QTMOC := /usr/bin/moc |
---|
79 | else |
---|
80 | QTMOC := $(QTHOME)/bin/moc |
---|
81 | endif |
---|
82 | endif |
---|
83 | |
---|
84 | QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' ) |
---|
85 | |
---|
86 | ifndef QTFLAGS |
---|
87 | ifeq ($(QT_VERSION),4) |
---|
88 | QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers |
---|
89 | QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers |
---|
90 | QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers |
---|
91 | else |
---|
92 | QTFLAGS := -I $(QTHOME)/include/Qt -I$(QTHOME)/include |
---|
93 | endif |
---|
94 | endif |
---|
95 | |
---|
96 | ifndef QTLIBPATH |
---|
97 | ifeq ($(QT_VERSION),3) |
---|
98 | QTLIBPATH := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "/lib/qt3/lib" || echo "/lib" ) |
---|
99 | else |
---|
100 | QTLIBPATH := -F$(QTHOME) |
---|
101 | endif |
---|
102 | endif |
---|
103 | ifndef QTLIBS |
---|
104 | ifeq ($(QT_VERSION),3) |
---|
105 | QTLIBS := -L$(QTHOME)$(QTLIBPATH) |
---|
106 | QT3_MT := $(shell ls $(QTHOME)$(QTLIBPATH)/libqt-mt.* | wc -l ) |
---|
107 | ifneq ($(QT3_MT),0) |
---|
108 | QTLIBS += -lqt-mt |
---|
109 | else |
---|
110 | QTLIBS += -lqt |
---|
111 | endif |
---|
112 | QTLIBS += -lqui |
---|
113 | else |
---|
114 | QTLIBS := -framework QtCore -framework QtGui |
---|
115 | endif |
---|
116 | endif |
---|
117 | |
---|
118 | ifndef GLQTLIBS |
---|
119 | ifeq ($(QT_VERSION),3) |
---|
120 | # already done in QTLIBS |
---|
121 | # GLQTLIBS := $(QTLIBS) |
---|
122 | else |
---|
123 | GLQTLIBS := -F$(QTHOME) -framework QtCore -framework QtGui |
---|
124 | GLQTLIBS += -framework QtOpenGL |
---|
125 | endif |
---|
126 | endif |
---|
127 | |
---|
128 | define build-granular-shared-lib |
---|
129 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
130 | cd $(G4TMPDIR); \ |
---|
131 | g++ -dynamiclib -single_module -undefined dynamic_lookup \ |
---|
132 | -o $$libdir/$(@F) $(INTYLIBS) *.o |
---|
133 | endef |
---|
134 | define build-global-shared-lib |
---|
135 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
136 | cd $(G4TMP)/$(G4SYSTEM); \ |
---|
137 | g++ -dynamiclib -single_module -undefined dynamic_lookup \ |
---|
138 | -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o); |
---|
139 | endef |
---|
140 | |
---|
141 | endif |
---|