1 | # $Id: macosx.gmk,v 1.5 2008/12/01 06:47:39 kmura Exp $ |
---|
2 | # $Name: geant4-09-04-beta-01 $ |
---|
3 | # =========================================================== |
---|
4 | # System specific terms |
---|
5 | # |
---|
6 | # MacOSX 10.4 (Tiger/Leopard) gcc 4.0.1 |
---|
7 | # Note: gc-3.3 is not valid for this setup. |
---|
8 | # =========================================================== |
---|
9 | |
---|
10 | # compile flags |
---|
11 | CXX := g++ |
---|
12 | |
---|
13 | ifdef COMPILE_WITH_BOOST |
---|
14 | CXXFLAGS := -ftemplate-depth-256 -Wno-long-double |
---|
15 | CXXFLAGS += -no-cpp-precomp -finline-functions -Wno-inline |
---|
16 | CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB |
---|
17 | CXXFLAGS += -O2 |
---|
18 | ifndef DEBUG |
---|
19 | CXXFLAGS += -DNDEBUG |
---|
20 | endif |
---|
21 | else |
---|
22 | CXXFLAGS := -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long |
---|
23 | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe |
---|
24 | CXXFLAGS += -O2 |
---|
25 | endif |
---|
26 | |
---|
27 | ifdef COMPILE_G4PY |
---|
28 | CXXFLAGS := -ansi -pipe |
---|
29 | CXXFLAGS += -ftemplate-depth-256 -Wno-long-double |
---|
30 | CXXFLAGS += -no-cpp-precomp -finline-functions -Wno-inline |
---|
31 | CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB |
---|
32 | CXXFLAGS += -O2 |
---|
33 | ifndef DEBUG |
---|
34 | CXXFLAGS += -DNDEBUG |
---|
35 | endif |
---|
36 | endif |
---|
37 | |
---|
38 | # extention of shared library |
---|
39 | soext := dylib |
---|
40 | modext := so |
---|
41 | |
---|
42 | # implicit rules |
---|
43 | %.o: %.cc |
---|
44 | ifdef CPPVERBOSE |
---|
45 | $(CXX) -c -o $@ $(CXXFLAGS) $(CPPFLAGS) $*.cc |
---|
46 | else |
---|
47 | @echo Compiling $< ... |
---|
48 | @$(CXX) -c -o $@ $(CXXFLAGS) $(CPPFLAGS) $*.cc |
---|
49 | endif |
---|
50 | |
---|
51 | %.pyc: %.py; python -c 'import py_compile; py_compile.compile( "$<" )' |
---|
52 | %.pyo: %.py; python -O -c 'import py_compile; py_compile.compile( "$<" )' |
---|
53 | |
---|
54 | |
---|
55 | # building a shared library |
---|
56 | ifdef LOCALLIB |
---|
57 | install_path := $(PWD) |
---|
58 | else |
---|
59 | install_path := $(Q_LIBDIR) |
---|
60 | endif |
---|
61 | |
---|
62 | |
---|
63 | ifdef CPPVERBOSE |
---|
64 | define build-library |
---|
65 | $(CXX) -dynamiclib -single_module -undefined dynamic_lookup \ |
---|
66 | -o $@ -install_name $(install_path)/$@ $(objects) |
---|
67 | endef |
---|
68 | else |
---|
69 | define build-library |
---|
70 | @echo Building a module $@ ... |
---|
71 | @$(CXX) -dynamiclib -single_module -undefined dynamic_lookup \ |
---|
72 | -o $@ -install_name $(install_path)/$@ $(objects) |
---|
73 | endef |
---|
74 | endif |
---|
75 | |
---|
76 | # building a module |
---|
77 | ifdef CPPVERBOSE |
---|
78 | define build-module |
---|
79 | $(CXX) -Wl,-x -bundle -flat_namespace -dead_strip \ |
---|
80 | -o $@ $(objects) $(LOPT) |
---|
81 | endef |
---|
82 | else |
---|
83 | define build-module |
---|
84 | @echo Building a module $@ ... |
---|
85 | @$(CXX) -Wl,-x -bundle -flat_namespace -dead_strip \ |
---|
86 | -o $@ $(objects) $(LOPT) |
---|
87 | endef |
---|
88 | endif |
---|
89 | |
---|