CODE_CHECK=java rules.ALICE.ALICERuleChecker
REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
-#-------------------------------------------------------------------------------
-# Include library definition
-
-include build/Makefile.config
-
#-------------------------------------------------------------------------------
# Include machine dependent macros
#-------------------------------------------------------------------------------
# Libraries to link binaries against
# Libraries will be linked against SHLIB
+# ROOT libraries
+
+ROOTCLIBS := $(shell root-config --glibs) -lThread -lMinuit -lHtml -lVMC -lGeom
-LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS)
+ROOTPLIBS := -lEG -lEGPythia6
+
+ALILIBS := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
+ -lITS -lPHOS -lCRT -lRICH -lVZERO -lZDC -lSTRUCT \
+ -lSTART -lEVGEN -lSTEER -lCONTAINERS
+
+LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
#-------------------------------------------------------------------------------
# default target
default:
$(MUTE)$(MAKE) aliroot
+FORCE:
+
#-------------------------------------------------------------------------------
# Each module will add to these macros
SOEXT = so
#System libraries
-SYSLIBS = -lbsd
# Flags for static libraries
AFLAGS = $(filter-out -rpath /usr/lib/cmplrs/cxx -msym -shared /usr/lib/cmplrs/cc/crt0.o,$(SOFLAGS))
AFLAGS += $(SHLIB)
# Additional flags and libraries for building aliroot executable
-EXEFLAGS += -lXm -lXt -lX11 -lPW -lUfor -lfor -lFutil -lots
-EXEFLAGS += -taso
+SYSLIBS := -lXm -lXt -lX11 -lPW -lUfor -lfor -lFutil -lots -taso -lbsd
# Cure funny problem
# sometimes in dependencies system include files of the sort
+++ /dev/null
-# ROOT libraries
-ROOTLIBS := $(shell root-config --glibs) -lThread -lMinuit -lHtml -lEG -lEGPythia6 -lVMC -lGeom \
- -L/usr/X11R6/lib -lX11
-
-# Additional flags for building aliroot executable
-EXEFLAGS =
-
-ALILIBS = -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
- -lITS -lPHOS -lCRT -lRICH -lVZERO -lZDC -lSTRUCT \
- -lSTART -lEVGEN -lSTEER -lCONTAINERS
SOEXT = sl
# additional ROOT libraries
-ROOTLIBS += -lcrypt
+SYSLIBS := -lcrypt -L/usr/lib/X11R6 -lX11
-GLIBS = -L/usr/lib/X11R6 -lX11
-
-# System libraries
AEXT = a
# additional ROOT libraries
-ROOTLIBS += -lcrypt
LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
-GLIBS = -L/usr/X11R6/lib -lX11 $(LIBNOVER)
#System libraries
-SYSLIBS = -ldl
+SYSLIBS := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11 $(LIBNOVER)
-EXEFLAGS+= -lg2c
AEXT = a
# additional ROOT libraries
-ROOTLIBS += -lcrypt
LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
-GLIBS = $(LIBNOVER)
-#System libraries
-SYSLIBS =
-
-EXEFLAGS+= -L/usr/local/lib -lXt -lCEPCF90 -lF90 -lPEPCF90 -lintrins
+SYSLIBS := $(LIBNOVER) -lcrypt -L/usr/local/lib -lXt -lCEPCF90 -lF90 \
+ -lPEPCF90 -lintrins -L/usr/X11R6/lib -lX11
\ No newline at end of file
AEXT = a
# additional ROOT libraries
-ROOTLIBS += -lcrypt
LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
-GLIBS = -L/usr/X11R6/lib -lX11 $(LIBNOVER)
#System libraries
-SYSLIBS = -ldl -lbsd
+SYSLIBS := -ldl -lbsd -lg2c -L/usr/X11R6/lib -lX11 $(LIBNOVER)
-EXEFLAGS+= -lg2c
AEXT = a
# additional ROOT libraries
-ROOTLIBS += -lcrypt
LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
-GLIBS = $(LIBNOVER)
#System libraries
-SYSLIBS =
-
-EXEFLAGS += -L/usr/local/lib -lXt
-EXEFLAGS += -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \
+SYSLIBS := -lcrypt -L/usr/X11R6/lib -lX11 $(LIBNOVER) -L/usr/local/lib \
+ -lXt -L$(shell which ifort | sed -e 's|bin/ifort|lib|')
-lifcore -lifport
AEXT = a
# additional ROOT libraries
-ROOTLIBS += -lcrypt
LIBNOVER = `find /lib64 -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib64/ -l/'`
-GLIBS = -L/usr/X11R6/lib64 -lX11 $(LIBNOVER)
#System libraries
-SYSLIBS = -ldl
+SYSLIBS := -ldl -lcrypt -L/usr/X11R6/lib64 -lX11 $(LIBNOVER)
-EXEFLAGS+= -lg2c
+EXEFLAGS := -lg2c
CXXNOOPT = $(NOOPT)
COPT = $(OPT)
FOPT = $(OPT) -fno-second-underscore
+ifeq (g95,$(findstring g95,$(ROOTBUILD)))
+FOPT += -fbounds-check
+endif
# CERNLIB defines
CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
CLIBFOPT = $(CLIBDEFS)
# Compiler flags
-CXXFLAGS = $(CXXOPT) -Wall -W -Wno-long-double -pipe -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include
+CXXFLAGS = $(CXXOPT) -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -I$(FINK_ROOT)/include #-Weffc++ -Woverloaded-virtual
ifeq (g95,$(findstring g95,$(ROOTBUILD)))
CXXFLAGS+=-DFORTRAN_G95
DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
-GLIBS = -L/usr/X11R6/lib -lX11
+SYSLIBS := -L/usr/X11R6/lib -lX11
-EXEFLAGS += -bind_at_load
+EXEFLAGS := -bind_at_load
#System libraries
ifeq (g95,$(findstring g95,$(ROOTBUILD)))
-SYSLIBS := -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95
+SYSLIBS += -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95
else
-SYSLIBS := -ldl -L$(dir $(shell find $(FINK_ROOT) -name libgfortran.dylib)) -lgfortranbegin -lgfortran
+SYSLIBS += -ldl -L$(dir $(shell find $(FINK_ROOT) -name libgfortran.dylib)) -lgfortranbegin -lgfortran
endif
-
-
ALLIB =
AEXT = a
-GLIBS = -L/usr/X11R6/lib -lX11
#System libraries
-SYSLIBS = -ldl
+SYSLIBS := -ldl -L/usr/X11R6/lib -lX11
-EXEFLAGS+= -Wl,-bind_at_load
+EXEFLAGS := -Wl,-bind_at_load
SHLD = $(LD)
SOFLAGS = -G $(LDFLAGS) $(SHLIB)
-ROOTLIBS += -lm -ldl -lnsl -lsocket
+SYSLIBS := -L/usr/dt/lib -L/usr/openwin/lib -L/usr/ccs/lib -lXm -lXt \
+ -lX11 -lm -lgen -ldl -lsocket -lsunmath -lrtc -lnsl
# Additional flags and libraries for building aliroot executable
-EXEFLAGS += -O -Qoption ld -t -L/usr/dt/lib -L/usr/openwin/lib -L/usr/ccs/lib -lXm -lXt -lX11 -lm -lgen -ldl -lsocket -lsunmath -lrtc
+
+EXEFLAGS := -O -Qoption ld -t
PACKDYFLAGS:=
PACKSOFLAGS:=
PACKLDFLAGS:=
+PACKBLIBS:=
EXPORT:=
EHDRS:=
CINTHDRS:=
@PACKAGE@DCXXFLAGS:=$(PACKDCXXFLAGS)
endif
+ifndef PACKBLIBS
+@PACKAGE@BLIBS:=$(LIBS)
+else
+@PACKAGE@BLIBS:=$(PACKBLIBS)
+endif
+
ifdef DHDR
WITHDICT=YES
#############################################################################
# Package Dictionary
-
@PACKAGE@DH:=$(MODDIR)/$(DHDR)
-
#All objects
@PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o))
TEMP:=$(FSRCS:.F=.o)
@echo "***** Making executable $@ *****"
endif
ifeq ($(ALIPROFILE),YES)
- $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(LIBS) $(EXEFLAGS) -o $@
+ $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
else
- $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@
+ $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
endif
-$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk
+$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk @MODULE@/tgt_$(ALICE_TARGET)/@PACKAGE@_srcslist
ifndef ALIQUIET
@echo "***** Creating $@ *****";
endif
endif
$(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS)
+$(MODDIRO)/@PACKAGE@_srcslist: FORCE
+ @for i in $(@PACKAGE@CS) $(@PACKAGE@S); do echo $$i; done | sort > $@.new ;\
+ diff $@ $@.new | sed -n -e "s?^\< *@MODULE@?@MODULE@/tgt_$(ALICE_TARGET)?p" | \
+ sed -e "s?\.c.*\$$?.\*?" | xargs \rm -f ;\
+ diff -q -w >/dev/null 2>&1 $@ $@.new ;\
+ if [ $$? -ne 0 ]; then \mv $@.new $@; echo "***** Source changed, remaking $(@PACKAGE@DS) *****";\
+ else \rm $@.new; fi
+
#Different targets for the module
ifeq ($(TYPE),lib)