23 |
export RESET=tput sgr0 |
export RESET=tput sgr0 |
24 |
# |
# |
25 |
export BASEDIR=$(shell echo `pwd`) |
export BASEDIR=$(shell echo `pwd`) |
26 |
export LD_LIBRARY_PATH+=$(BASEDIR)/event |
#export LD_LIBRARY_PATH+=:$(BASEDIR)/event/ |
27 |
# |
# |
28 |
export LDFLAGS+=$(PAM_BIT) |
export LDFLAGS+=$(PAM_BIT) |
29 |
export CFLAGS+=$(PAM_BIT) |
export CFLAGS+=$(PAM_BIT) -g |
30 |
export FFLAGS+=$(PAM_BIT) |
export FFLAGS+=$(PAM_BIT) -g |
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 |
37 |
# |
# |
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 |
|
YodaProfiler: YodaProfiler/inc/* YodaProfiler/src/* |
52 |
|
ifeq ($(verbose),) |
53 |
|
@for sub_dir in "YodaProfiler" ; do \ |
54 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make all in $$sub_dir "; ${RESET}) && make -s BASEDIR=$(BASEDIR)) ; \ |
55 |
|
done |
56 |
|
else |
57 |
|
for sub_dir in "YodaProfiler" ; do \ |
58 |
|
( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ |
59 |
|
done |
60 |
|
endif |
61 |
|
|
62 |
distclean: |
distclean: |
63 |
|
ifeq ($(verbose),) |
64 |
|
@for sub_dir in $(DIRS) ; do \ |
65 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make distclean in $$sub_dir "; ${RESET}) && make -s distclean) ; \ |
66 |
|
done |
67 |
|
@for sub_dir in `find ./ -name obj` ; do \ |
68 |
|
rm -rf $$sub_dir ; \ |
69 |
|
done |
70 |
|
else |
71 |
for sub_dir in $(DIRS) ; do \ |
for sub_dir in $(DIRS) ; do \ |
72 |
( cd $$sub_dir && make distclean) ; \ |
( cd $$sub_dir && make distclean) ; \ |
73 |
done |
done |
74 |
for sub_dir in `find ./ -name obj` ; do \ |
for sub_dir in `find ./ -name obj` ; do \ |
75 |
rm -rf $$sub_dir ; \ |
rm -rf $$sub_dir ; \ |
76 |
done |
done |
77 |
|
endif |
78 |
|
|
79 |
install: |
install: |
80 |
|
ifeq ($(verbose),) |
81 |
@(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
@(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
82 |
@if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
@if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
83 |
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
94 |
@if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
@if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
95 |
@if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
@if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
96 |
@if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
@if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
97 |
@(${EGREEN} " Installing "${EWHITE}"libyoda.so "; ${RESET}) |
@(${EGREEN} " Installing: library "${WHITE}"libyoda.so "; ${RESET}) |
98 |
@cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
@cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
99 |
@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 |
100 |
@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 |
101 |
@(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
@(${EGREEN} " Installing: exec file "${WHITE}"chewbacca"; ${RESET}) |
102 |
@cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
@cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
103 |
@(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
@(${EGREEN} " Installing: "${WHITE}"yoda headers";${RESET}) |
104 |
@(cd $(BASEDIR)/event/ && make distclean) |
@(cd $(BASEDIR)/event/ &>/dev/null && make -s distclean) |
105 |
@rm -rf $(PAM_INC)/yoda/ |
@rm -rf $(PAM_INC)/yoda/ |
106 |
@cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda/ |
@cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
107 |
@cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
@cp -rf $(PAM_LIB)/libyoda.so.0.0.0 $(BASEDIR)/event/ |
108 |
|
@ln -sf $(BASEDIR)/event/libyoda.so.0.0.0 $(BASEDIR)/event/libyoda.so |
109 |
@(${EGREEN}"") |
@(${EGREEN}"") |
110 |
@(cd YodaProfiler && make forceinstall) |
@(cd YodaProfiler &>/dev/null && make -s forceinstall) |
111 |
|
else |
112 |
|
(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
113 |
|
if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
114 |
|
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
115 |
|
(${ERED} ""; ${RESET}); \ |
116 |
|
exit; fi |
117 |
|
if [ ! -d $(PAM_HOME) ]; then mkdir $(PAM_HOME); fi |
118 |
|
if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi |
119 |
|
if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi |
120 |
|
if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi |
121 |
|
ln -sf $(PAM_SOFTWARE)/inc $(PAM_SOFTWARE)/include |
122 |
|
if [ ! -d $(PAM_BIN) ]; then mkdir $(PAM_BIN); fi |
123 |
|
if [ ! -d $(PAM_DOC) ]; then mkdir $(PAM_DOC); fi |
124 |
|
if [ ! -d $(PAM_MACROS) ]; then mkdir $(PAM_MACROS); fi |
125 |
|
if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
126 |
|
if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
127 |
|
if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
128 |
|
(${EGREEN} " Installing "${EWHITE}"libyoda.so "; ${RESET}) |
129 |
|
cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
130 |
|
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so |
131 |
|
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 |
132 |
|
(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
133 |
|
cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
134 |
|
(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
135 |
|
(cd $(BASEDIR)/event/ && make distclean) |
136 |
|
rm -rf $(PAM_INC)/yoda/ |
137 |
|
cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
138 |
|
cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
139 |
|
ln -sf $(BASEDIR)/event/libyoda.so.0.0.0 $(BASEDIR)/event/libyoda.so |
140 |
|
(${EGREEN}"") |
141 |
|
(cd YodaProfiler && make forceinstall) |
142 |
|
endif |