1 |
mocchiut |
1.1 |
# An almost general purpouse Makefile for PAMELA repository |
2 |
|
|
# Let's start with some usefull definition for colorize the echo |
3 |
|
|
export RED='\E[1;31;40m' |
4 |
|
|
export GREEN='\E[1;32;40m' |
5 |
|
|
export YELLOW='\E[1;33;40m' |
6 |
|
|
export BLUE='\E[1;34;40m' |
7 |
|
|
export WHITE='\E[1;37;40m' |
8 |
|
|
export VIOLET='\E[1;35;40m' |
9 |
|
|
export CYAN='\E[1;36;40m' |
10 |
|
|
# Here the echo definition to use them |
11 |
|
|
export EVIOLET=echo -e ${VIOLET} |
12 |
|
|
export ECYAN=echo -e ${CYAN} |
13 |
|
|
export ERED=echo -e ${RED} |
14 |
|
|
export EGREEN=echo -e ${GREEN} |
15 |
|
|
export EYELLOW=echo -e ${YELLOW} |
16 |
|
|
export EBLUE=echo -e ${BLUE} |
17 |
|
|
export EWHITE=echo -e ${WHITE} |
18 |
|
|
# Reset the terminal |
19 |
|
|
export RESET=tput sgr0 |
20 |
|
|
# Enviroment: |
21 |
|
|
export GCCVER=`gcc --version | head -1` |
22 |
|
|
export UNAMEA=`uname -a` |
23 |
|
|
export TODAY=`date` |
24 |
|
|
# |
25 |
|
|
ifeq ($(GCC4),) |
26 |
|
|
export GCCVERS=$(shell echo `gcc -dumpversion | sed 's/\./\ /g'`) |
27 |
|
|
export GCCVERMAJ=$(word 1,$(GCCVERS)) |
28 |
|
|
export GCC4=$(shell echo `echo "${GCCVERMAJ} > 3" |bc -l`) |
29 |
|
|
endif |
30 |
|
|
# |
31 |
|
|
# Here the variables used to override the standard make flags |
32 |
|
|
# C |
33 |
|
|
export CC=gcc |
34 |
|
|
#CFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
35 |
|
|
export CFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
36 |
|
|
# F77 |
37 |
|
|
ifeq ($(GCC4),1) |
38 |
|
|
export F77=gfortran |
39 |
|
|
export LG2C=-lgfortran |
40 |
|
|
export EXTRAOPT= |
41 |
|
|
else |
42 |
|
|
export F77=g77 |
43 |
|
|
export LG2C=-lg2c |
44 |
|
|
export EXTRAOPT=-Wno-globals -fvxt |
45 |
|
|
endif |
46 |
|
|
#F77FLAGS= -Wall -Wno-globals -fvxt -fno-automatic -fbounds-check -g -extend_source -static -fno-backslash ${PAM_BIT} |
47 |
|
|
export F77FLAGS= -Wall -funroll-loops -fPIC $(EXTRAOPT) -fno-automatic -fbounds-check -extend_source -static -fno-backslash ${PAM_BIT} |
48 |
|
|
# C++ |
49 |
|
|
export CXX=g++ |
50 |
|
|
export CXXFLAGS=-Wall -O -fPIC -pthread -g ${PAM_BIT} |
51 |
|
|
#export CXXFLAGS=-Wall -O3 -funroll-loops -fPIC -pthread ${PAM_BIT} |
52 |
|
|
# ROOTCINT |
53 |
|
|
export ROOTCINT=rootcint |
54 |
|
|
|