1 | # |
---|
2 | # ------ GNU/LINUX ------ gcc 3.2 and higher |
---|
3 | # |
---|
4 | ifeq ($(G4SYSTEM),Linux-g++) |
---|
5 | CXX := g++ |
---|
6 | CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long |
---|
7 | CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe |
---|
8 | # |
---|
9 | # Uncomment the following options to activate Pentium4 chip specific |
---|
10 | # floating-point operations on the SSE unit. It will allow for more stable |
---|
11 | # results (no output differences between debug/optimised runs) and little |
---|
12 | # performance improvement (in the order of 2%). |
---|
13 | # NOTE: binaries built using these options will NOT be portable cross |
---|
14 | # platforms. Will only run on Pentium4-based architectures ! |
---|
15 | # |
---|
16 | # CXXFLAGS += -march=pentium4 -mfpmath=sse |
---|
17 | ifdef G4OPTIMISE |
---|
18 | CXXFLAGS += -O2 |
---|
19 | FCFLAGS := -O2 |
---|
20 | CCFLAGS := -O2 |
---|
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 |
---|
33 | ifdef G4LIB_BUILD_SHARED |
---|
34 | CXXFLAGS += -fPIC |
---|
35 | FCFLAGS += -fPIC |
---|
36 | CCFLAGS += -fPIC |
---|
37 | endif |
---|
38 | G4RUNPATHOPTION := -Wl,-rpath |
---|
39 | CC := gcc |
---|
40 | FC := g77 |
---|
41 | FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore |
---|
42 | FCLIBS := -lg2c -lnsl |
---|
43 | ECHO := /bin/echo -e |
---|
44 | SHEXT := so |
---|
45 | ifndef X11FLAGS |
---|
46 | X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 |
---|
47 | endif |
---|
48 | ifndef X11LIBS |
---|
49 | X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE |
---|
50 | endif |
---|
51 | ifndef XMFLAGS |
---|
52 | XMFLAGS := -I/usr/X11R6/include |
---|
53 | endif |
---|
54 | ifndef XMLIBS |
---|
55 | XMLIBS := -lXm -lXpm |
---|
56 | endif |
---|
57 | ifndef XAWFLAGS |
---|
58 | XAWFLAGS := -I/usr/X11R6/include |
---|
59 | endif |
---|
60 | ifndef XAWLIBS |
---|
61 | XAWLIBS := -lXaw |
---|
62 | endif |
---|
63 | DLDLIBS := -ldl |
---|
64 | ifndef OGLFLAGS |
---|
65 | OGLFLAGS := -I$(OGLHOME)/include |
---|
66 | endif |
---|
67 | ifndef OGLLIBS |
---|
68 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL |
---|
69 | endif |
---|
70 | define build-granular-shared-lib |
---|
71 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
72 | cd $(G4TMPDIR); \ |
---|
73 | $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o |
---|
74 | endef |
---|
75 | define build-global-shared-lib |
---|
76 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
77 | cd $(G4TMP)/$(G4SYSTEM); \ |
---|
78 | $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \ |
---|
79 | $(foreach dir,$(SUBLIBS),$(dir)/*.o); |
---|
80 | endef |
---|
81 | |
---|
82 | endif |
---|