[472] | 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 |
---|
[865] | 33 | ifdef G4OPTDEBUG |
---|
| 34 | CXXFLAGS += -O2 -g |
---|
| 35 | FCFLAGS += -O2 -g |
---|
| 36 | CCFLAGS += -O2 -g |
---|
| 37 | endif |
---|
[472] | 38 | ifdef G4LIB_BUILD_SHARED |
---|
| 39 | CXXFLAGS += -fPIC |
---|
| 40 | FCFLAGS += -fPIC |
---|
| 41 | CCFLAGS += -fPIC |
---|
| 42 | endif |
---|
| 43 | G4RUNPATHOPTION := -Wl,-rpath |
---|
| 44 | CC := gcc |
---|
[758] | 45 | FC := gfortran |
---|
[472] | 46 | FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore |
---|
| 47 | FCLIBS := -lg2c -lnsl |
---|
| 48 | ECHO := /bin/echo -e |
---|
| 49 | SHEXT := so |
---|
| 50 | ifndef X11FLAGS |
---|
| 51 | X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 |
---|
| 52 | endif |
---|
| 53 | ifndef X11LIBS |
---|
| 54 | X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE |
---|
| 55 | endif |
---|
| 56 | ifndef XMFLAGS |
---|
| 57 | XMFLAGS := -I/usr/X11R6/include |
---|
| 58 | endif |
---|
| 59 | ifndef XMLIBS |
---|
| 60 | XMLIBS := -lXm -lXpm |
---|
| 61 | endif |
---|
[606] | 62 | ifndef QTHOME |
---|
[865] | 63 | QTHOME := /usr |
---|
[606] | 64 | endif |
---|
[868] | 65 | |
---|
[726] | 66 | ifndef QTMOC |
---|
[758] | 67 | QTMOC := $(QTHOME)/bin/moc |
---|
[726] | 68 | endif |
---|
[865] | 69 | |
---|
[875] | 70 | QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' ) |
---|
[865] | 71 | |
---|
[875] | 72 | ifndef QTFLAGS |
---|
| 73 | ifeq ($(QT_VERSION),4) |
---|
| 74 | QTFLAGS := -I $(QTHOME)/include/qt$(QT_VERSION)/QtCore |
---|
| 75 | QTFLAGS += -I $(QTHOME)/include/qt$(QT_VERSION)/QtGui |
---|
| 76 | QTFLAGS += -I $(QTHOME)/include/qt$(QT_VERSION)/QtOpenGL |
---|
[865] | 77 | else |
---|
[875] | 78 | QTFLAGS := -I$(QTHOME)/include/qt$(QT_VERSION)/Qt |
---|
| 79 | QTFLAGS += -I$(QTHOME)/include/qt$(QT_VERSION) |
---|
[865] | 80 | endif |
---|
[606] | 81 | endif |
---|
[875] | 82 | |
---|
| 83 | |
---|
| 84 | ifndef QTLIBPATH |
---|
| 85 | QT_SEARCH_LIB1 := $(shell ls $(QTHOME)/lib/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l ) |
---|
| 86 | QT_SEARCH_LIB2 := $(shell ls $(QTHOME)/lib/libq* 2>/dev/null | wc -l ) |
---|
| 87 | ifneq ($(QT_SEARCH_LIB1),0) |
---|
| 88 | QTLIBPATH := /lib/qt$(QT_VERSION) |
---|
| 89 | endif |
---|
| 90 | ifneq ($(QT_SEARCH_LIB2),0) |
---|
| 91 | QTLIBPATH := /lib |
---|
| 92 | endif |
---|
| 93 | endif |
---|
| 94 | |
---|
[790] | 95 | ifndef QTLIBS |
---|
[875] | 96 | QTLIBS := -L$(QTHOME)$(QTLIBPATH) |
---|
| 97 | ifeq ($(QT_VERSION),3) |
---|
| 98 | QT3_MT := $(shell ls $(QTHOME)$(QTLIBPATH)/libqt-mt.* | wc -l ) |
---|
| 99 | ifneq ($(QT3_MT),0) |
---|
| 100 | QTLIBS += -lqt-mt |
---|
| 101 | else |
---|
| 102 | QTLIBS += -lqt |
---|
| 103 | endif |
---|
| 104 | QTLIBS += -lqui |
---|
[865] | 105 | else |
---|
[875] | 106 | QTLIBS += -lQtCore -lQtGui |
---|
[865] | 107 | endif |
---|
[790] | 108 | endif |
---|
[875] | 109 | |
---|
| 110 | ifndef GLQTLIBS |
---|
| 111 | ifeq ($(QT_VERSION),3) |
---|
| 112 | # already done in QTLIBS |
---|
| 113 | # GLQTLIBS := $(QTLIBS) |
---|
| 114 | else |
---|
| 115 | GLQTLIBS := -L$(QTHOME)$(QTLIBPATH) -lQtCore -lQtGui -lQtOpenGL |
---|
| 116 | endif |
---|
| 117 | endif |
---|
| 118 | |
---|
[472] | 119 | ifndef XAWFLAGS |
---|
| 120 | XAWFLAGS := -I/usr/X11R6/include |
---|
| 121 | endif |
---|
| 122 | ifndef XAWLIBS |
---|
| 123 | XAWLIBS := -lXaw |
---|
| 124 | endif |
---|
| 125 | DLDLIBS := -ldl |
---|
| 126 | ifndef OGLFLAGS |
---|
| 127 | OGLFLAGS := -I$(OGLHOME)/include |
---|
| 128 | endif |
---|
| 129 | ifndef OGLLIBS |
---|
| 130 | OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL |
---|
| 131 | endif |
---|
| 132 | define build-granular-shared-lib |
---|
| 133 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
| 134 | cd $(G4TMPDIR); \ |
---|
| 135 | $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o |
---|
| 136 | endef |
---|
| 137 | define build-global-shared-lib |
---|
| 138 | @libdir=`(cd $(@D);/bin/pwd)`; \ |
---|
| 139 | cd $(G4TMP)/$(G4SYSTEM); \ |
---|
| 140 | $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \ |
---|
| 141 | $(foreach dir,$(SUBLIBS),$(dir)/*.o); |
---|
| 142 | endef |
---|
| 143 | |
---|
| 144 | endif |
---|