150 lines
4.2 KiB
Plaintext
150 lines
4.2 KiB
Plaintext
#
|
|
# ------ GNU/LINUX ------ gcc 3.2 and higher
|
|
#
|
|
ifeq ($(G4SYSTEM),Linux-g++)
|
|
CXX := g++
|
|
CXXFLAGS := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
|
|
CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
|
|
CXXFLAGS += -Wshadow
|
|
#
|
|
# Uncomment the following options to activate Pentium4 chip specific
|
|
# floating-point operations on the SSE unit. It will allow for more stable
|
|
# results (no output differences between debug/optimised runs) and little
|
|
# performance improvement (in the order of 2%).
|
|
# NOTE: binaries built using these options will NOT be portable cross
|
|
# platforms. Will only run on Pentium4-based architectures !
|
|
#
|
|
# CXXFLAGS += -march=pentium4 -mfpmath=sse
|
|
ifdef G4MULTITHREADED
|
|
CXXFLAGS += -ftls-model=initial-exec -pthread
|
|
endif
|
|
ifdef G4OPTIMISE
|
|
CXXFLAGS += -O2
|
|
FCFLAGS := -O2
|
|
CCFLAGS := -O2
|
|
else
|
|
ifdef G4DEBUG
|
|
CXXFLAGS += -g
|
|
FCFLAGS := -g
|
|
CCFLAGS := -g
|
|
endif
|
|
endif
|
|
ifdef G4PROFILE
|
|
CXXFLAGS += -pg
|
|
FCFLAGS += -pg
|
|
CCFLAGS += -pg
|
|
endif
|
|
ifdef G4OPTDEBUG
|
|
CXXFLAGS += -O2 -g
|
|
FCFLAGS += -O2 -g
|
|
CCFLAGS += -O2 -g
|
|
endif
|
|
ifdef G4LIB_BUILD_SHARED
|
|
ifndef G4MULTITHREADED
|
|
CXXFLAGS += -fPIC
|
|
FCFLAGS += -fPIC
|
|
CCFLAGS += -fPIC
|
|
endif
|
|
endif
|
|
G4RUNPATHOPTION := -Wl,-rpath
|
|
CC := gcc
|
|
FC := gfortran
|
|
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
|
|
FCLIBS := -lg2c -lnsl
|
|
ECHO := /bin/echo -e
|
|
SHEXT := so
|
|
ARCH := $(shell uname -m | cut -s -d "_" -f 2)
|
|
LOADLIBS += -lm -lstdc++
|
|
ifndef X11FLAGS
|
|
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
|
|
endif
|
|
ifndef X11LIBS
|
|
X11LIBS := -L/usr/X11R6/lib$(ARCH) -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
|
|
endif
|
|
ifndef XMFLAGS
|
|
XMFLAGS := -I/usr/X11R6/include
|
|
endif
|
|
ifndef XMLIBS
|
|
XMLIBS := -lXm -lXpm
|
|
endif
|
|
ifndef XAWFLAGS
|
|
XAWFLAGS := -I/usr/X11R6/include
|
|
endif
|
|
ifndef XAWLIBS
|
|
XAWLIBS := -lXaw
|
|
endif
|
|
DLDLIBS := -ldl
|
|
ifndef OGLFLAGS
|
|
OGLFLAGS := -I$(OGLHOME)/include
|
|
endif
|
|
ifndef OGLLIBS
|
|
OGLLIBS := -L$(OGLHOME)/lib$(ARCH) -lGLU -lGL
|
|
endif
|
|
|
|
# ---- QT Setup block -------------------------------------------------------
|
|
|
|
ifndef QTHOME
|
|
QTHOME := /usr
|
|
endif
|
|
ifndef QTMOC
|
|
QTMOC := $(QTHOME)/bin/moc
|
|
endif
|
|
|
|
QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
|
|
|
|
ifeq ($(QT_VERSION),5)
|
|
ifndef QTFLAGS # Qt5
|
|
QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt
|
|
QTFLAGS += -I $(QTHOME)/include/QtCore
|
|
QTFLAGS += -I $(QTHOME)/include/QtGui
|
|
QTFLAGS += -I $(QTHOME)/include/QtWidgets
|
|
QTFLAGS += -I $(QTHOME)/include/QtOpenGL
|
|
QTFLAGS += -I $(QTHOME)/include/QtPrintSupport
|
|
endif
|
|
else # Qt4
|
|
ifndef QTFLAGS
|
|
QTFLAGS := -I$(QTHOME)/include -I$(QTHOME)/include/Qt
|
|
QTFLAGS += -I$(QTHOME)/include/QtCore
|
|
QTFLAGS += -I$(QTHOME)/include/QtGui
|
|
QTFLAGS += -I$(QTHOME)/include/QtOpenGL
|
|
endif
|
|
endif
|
|
ifndef QTLIBPATH
|
|
QTLIBPATH := $(QTHOME)/lib
|
|
QT_SEARCH_LIB := $(shell ls $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
|
|
ifneq ($(QT_SEARCH_LIB),0)
|
|
QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION)
|
|
endif
|
|
endif
|
|
ifeq ($(QT_VERSION),5)
|
|
ifndef QTLIBS # Qt5
|
|
QTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtPrintSupport
|
|
endif
|
|
ifndef GLQTLIBS
|
|
GLQTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtOpenGL -lQtPrintSupport
|
|
endif
|
|
else # Qt4
|
|
ifndef QTLIBS
|
|
QTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui
|
|
endif
|
|
ifndef GLQTLIBS
|
|
GLQTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtOpenGL
|
|
endif
|
|
endif
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
define build-granular-shared-lib
|
|
@libdir=`(cd $(@D);/bin/pwd)`; \
|
|
cd $(G4TMPDIR); \
|
|
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
|
|
endef
|
|
define build-global-shared-lib
|
|
@libdir=`(cd $(@D);/bin/pwd)`; \
|
|
cd $(G4TMP)/$(G4SYSTEM); \
|
|
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
|
|
$(foreach dir,$(SUBLIBS),$(dir)/*.o);
|
|
endef
|
|
|
|
endif
|