1 |
# |
# |
2 |
# |
# |
3 |
# |
# |
4 |
|
export debug=0 |
5 |
|
export release=1 |
6 |
ifndef BASEDIR |
# |
7 |
BASEDIR =$(shell pwd) |
export RED='\E[1;31;40m' |
8 |
endif |
export GREEN='\E[1;32;40m' |
9 |
|
export YELLOW='\E[1;33;40m' |
10 |
ifdef release |
export BLUE='\E[1;34;40m' |
11 |
debug = 0 |
export WHITE='\E[1;37;40m' |
12 |
release = 1 |
export VIOLET='\E[1;35;40m' |
13 |
endif |
export CYAN='\E[1;36;40m' |
14 |
|
# Here the echo definition to use them |
15 |
ifndef release |
export EVIOLET=echo -e ${VIOLET} |
16 |
debug = 1 |
export ECYAN=echo -e ${CYAN} |
17 |
release = 0 |
export ERED=echo -e ${RED} |
18 |
|
export EGREEN=echo -e ${GREEN} |
19 |
|
export EYELLOW=echo -e ${YELLOW} |
20 |
|
export EBLUE=echo -e ${BLUE} |
21 |
|
export EWHITE=echo -e ${WHITE} |
22 |
|
# Reset the terminal |
23 |
|
export RESET=tput sgr0 |
24 |
|
# |
25 |
|
export BASEDIR=$(shell echo `pwd`) |
26 |
|
#export LD_LIBRARY_PATH+=:$(BASEDIR)/event/ |
27 |
|
# |
28 |
|
export LDFLAGS+=$(PAM_BIT) |
29 |
|
export CFLAGS+=$(PAM_BIT) |
30 |
|
export FFLAGS+=$(PAM_BIT) |
31 |
|
# |
32 |
|
ifeq ($(GCC4),) |
33 |
|
export GCCVERS=$(shell echo `gcc -dumpversion | sed 's/\./\ /g'`) |
34 |
|
export GCCVERMAJ=$(word 1,$(GCCVERS)) |
35 |
|
export GCC4=$(shell echo `echo "${GCCVERMAJ} > 3" |bc -l`) |
36 |
endif |
endif |
37 |
|
# |
|
export LDFLAGS+=$(PAM_BIT) |
|
|
export CFLAGS+=$(PAM_BIT) |
|
|
export FFLAGS+=$(PAM_BIT) |
|
|
|
|
38 |
DIRS=event PamOffLineSW YodaProfiler |
DIRS=event PamOffLineSW YodaProfiler |
39 |
|
# |
|
|
|
40 |
all: |
all: |
41 |
|
ifeq ($(verbose),) |
42 |
|
@for sub_dir in $(DIRS) ; do \ |
43 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make all in $$sub_dir "; ${RESET}) && make -s BASEDIR=$(BASEDIR)) ; \ |
44 |
|
done |
45 |
|
else |
46 |
for sub_dir in $(DIRS) ; do \ |
for sub_dir in $(DIRS) ; do \ |
47 |
( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ |
( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ |
48 |
done |
done |
49 |
|
endif |
50 |
|
|
51 |
distclean: |
distclean: |
52 |
|
ifeq ($(verbose),) |
53 |
|
@for sub_dir in $(DIRS) ; do \ |
54 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make distclean in $$sub_dir "; ${RESET}) && make -s distclean) ; \ |
55 |
|
done |
56 |
|
@for sub_dir in `find ./ -name obj` ; do \ |
57 |
|
rm -rf $$sub_dir ; \ |
58 |
|
done |
59 |
|
else |
60 |
for sub_dir in $(DIRS) ; do \ |
for sub_dir in $(DIRS) ; do \ |
61 |
( cd $$sub_dir && make distclean) ; \ |
( cd $$sub_dir && make distclean) ; \ |
62 |
done |
done |
63 |
for sub_dir in `find ./ -name obj` ; do \ |
for sub_dir in `find ./ -name obj` ; do \ |
64 |
rm -rf $$sub_dir ; \ |
rm -rf $$sub_dir ; \ |
65 |
done |
done |
66 |
|
endif |
67 |
|
|
68 |
install: |
install: |
69 |
if [ "$(PAM_SOFTWARE)" == "" ]; then echo "";\ |
ifeq ($(verbose),) |
70 |
echo "PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING";\ |
@(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
71 |
echo ""; \ |
@if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
72 |
|
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
73 |
|
(${ERED} ""; ${RESET}); \ |
74 |
|
exit; fi |
75 |
|
@if [ ! -d $(PAM_HOME) ]; then mkdir $(PAM_HOME); fi |
76 |
|
@if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi |
77 |
|
@if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi |
78 |
|
@if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi |
79 |
|
@ln -sf $(PAM_SOFTWARE)/inc $(PAM_SOFTWARE)/include |
80 |
|
@if [ ! -d $(PAM_BIN) ]; then mkdir $(PAM_BIN); fi |
81 |
|
@if [ ! -d $(PAM_DOC) ]; then mkdir $(PAM_DOC); fi |
82 |
|
@if [ ! -d $(PAM_MACROS) ]; then mkdir $(PAM_MACROS); fi |
83 |
|
@if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
84 |
|
@if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
85 |
|
@if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
86 |
|
@(${EGREEN} " Installing: library "${WHITE}"libyoda.so "; ${RESET}) |
87 |
|
@cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
88 |
|
@ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so |
89 |
|
@ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 |
90 |
|
@(${EGREEN} " Installing: exec file "${WHITE}"chewbacca"; ${RESET}) |
91 |
|
@cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
92 |
|
@(${EGREEN} " Installing: "${WHITE}"yoda headers";${RESET}) |
93 |
|
@(cd $(BASEDIR)/event/ &>/dev/null && make -s distclean) |
94 |
|
@rm -rf $(PAM_INC)/yoda/ |
95 |
|
@cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
96 |
|
@cp -rf $(PAM_LIB)/libyoda.so.0.0.0 $(BASEDIR)/event/ |
97 |
|
@(${EGREEN}"") |
98 |
|
@(cd YodaProfiler &>/dev/null && make -s forceinstall) |
99 |
|
else |
100 |
|
(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
101 |
|
if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
102 |
|
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
103 |
|
(${ERED} ""; ${RESET}); \ |
104 |
exit; fi |
exit; fi |
105 |
|
if [ ! -d $(PAM_HOME) ]; then mkdir $(PAM_HOME); fi |
106 |
if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi |
if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi |
107 |
if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi |
if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi |
108 |
if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi |
if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi |
113 |
if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
114 |
if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
115 |
if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
116 |
|
(${EGREEN} " Installing "${EWHITE}"libyoda.so "; ${RESET}) |
117 |
cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
118 |
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so |
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so |
119 |
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 |
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 |
120 |
cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda/ |
(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
121 |
cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
122 |
|
(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
123 |
|
(cd $(BASEDIR)/event/ && make distclean) |
124 |
|
rm -rf $(PAM_INC)/yoda/ |
125 |
|
cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
126 |
|
cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
127 |
|
(${EGREEN}"") |
128 |
(cd YodaProfiler && make forceinstall) |
(cd YodaProfiler && make forceinstall) |
129 |
|
endif |