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) |
32 |
DIRS=event PamOffLineSW YodaProfiler |
DIRS=event PamOffLineSW YodaProfiler |
33 |
# |
# |
34 |
all: |
all: |
35 |
|
ifeq ($(verbose),) |
36 |
|
@for sub_dir in $(DIRS) ; do \ |
37 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make all in $$sub_dir "; ${RESET}) && make -s BASEDIR=$(BASEDIR)) ; \ |
38 |
|
done |
39 |
|
else |
40 |
for sub_dir in $(DIRS) ; do \ |
for sub_dir in $(DIRS) ; do \ |
41 |
( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ |
( cd $$sub_dir && make BASEDIR=$(BASEDIR)) ; \ |
42 |
done |
done |
43 |
|
endif |
44 |
|
|
45 |
distclean: |
distclean: |
46 |
|
ifeq ($(verbose),) |
47 |
|
@for sub_dir in $(DIRS) ; do \ |
48 |
|
( cd $$sub_dir &>/dev/null && (${EGREEN} "Make distclean in $$sub_dir "; ${RESET}) && make -s distclean) ; \ |
49 |
|
done |
50 |
|
@for sub_dir in `find ./ -name obj` ; do \ |
51 |
|
rm -rf $$sub_dir ; \ |
52 |
|
done |
53 |
|
else |
54 |
for sub_dir in $(DIRS) ; do \ |
for sub_dir in $(DIRS) ; do \ |
55 |
( cd $$sub_dir && make distclean) ; \ |
( cd $$sub_dir && make distclean) ; \ |
56 |
done |
done |
57 |
for sub_dir in `find ./ -name obj` ; do \ |
for sub_dir in `find ./ -name obj` ; do \ |
58 |
rm -rf $$sub_dir ; \ |
rm -rf $$sub_dir ; \ |
59 |
done |
done |
60 |
|
endif |
61 |
|
|
62 |
install: |
install: |
63 |
|
ifeq ($(verbose),) |
64 |
@(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
@(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
65 |
@if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
@if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
66 |
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
84 |
@(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
@(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
85 |
@cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
@cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
86 |
@(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
@(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
87 |
@(cd $(BASEDIR)/event/ && make distclean) |
@(cd $(BASEDIR)/event/ &>/dev/null && make -s distclean) |
88 |
@rm -rf $(PAM_INC)/yoda/ |
@rm -rf $(PAM_INC)/yoda/ |
89 |
@cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda/ |
@cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
90 |
@cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
@cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
91 |
@(${EGREEN}"") |
@(${EGREEN}"") |
92 |
@(cd YodaProfiler && make forceinstall) |
@(cd YodaProfiler && make forceinstall) |
93 |
|
else |
94 |
|
(${EGREEN} " Creating PAMELA environment "; ${RESET}) |
95 |
|
if [ "$(PAM_SOFTWARE)" == "" ]; then (${ERED} ""; ${RESET}); \ |
96 |
|
(${ERED} " PLEASE SET THE PAMELA ENVIRONMENT BEFORE INSTALLING "; ${RESET}); \ |
97 |
|
(${ERED} ""; ${RESET}); \ |
98 |
|
exit; fi |
99 |
|
if [ ! -d $(PAM_HOME) ]; then mkdir $(PAM_HOME); fi |
100 |
|
if [ ! -d $(PAM_SOFTWARE) ]; then mkdir $(PAM_SOFTWARE); fi |
101 |
|
if [ ! -d $(PAM_LIB) ]; then mkdir $(PAM_LIB); fi |
102 |
|
if [ ! -d $(PAM_INC) ]; then mkdir $(PAM_INC); fi |
103 |
|
ln -sf $(PAM_SOFTWARE)/inc $(PAM_SOFTWARE)/include |
104 |
|
if [ ! -d $(PAM_BIN) ]; then mkdir $(PAM_BIN); fi |
105 |
|
if [ ! -d $(PAM_DOC) ]; then mkdir $(PAM_DOC); fi |
106 |
|
if [ ! -d $(PAM_MACROS) ]; then mkdir $(PAM_MACROS); fi |
107 |
|
if [ ! -d $(PAM_SRC) ]; then mkdir $(PAM_SRC); fi |
108 |
|
if [ ! -d $(PAM_CALIB) ]; then mkdir $(PAM_CALIB); fi |
109 |
|
if [ ! -d $(FEV_PLUGIN) ]&&[ "$(FEV_PLUGIN)" != "" ]; then mkdir $(FEV_PLUGIN); fi |
110 |
|
(${EGREEN} " Installing "${EWHITE}"libyoda.so "; ${RESET}) |
111 |
|
cp -f $(BASEDIR)/event/libyoda.so.0.0.0 $(PAM_LIB)/ |
112 |
|
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so |
113 |
|
ln -sf $(PAM_LIB)/libyoda.so.0.0.0 $(PAM_LIB)/libyoda.so.0 |
114 |
|
(${EGREEN} " Installing exec file "${EWHITE}"chewbacca"; ${RESET}) |
115 |
|
cp -f $(BASEDIR)/PamOffLineSW/chewbacca $(PAM_BIN)/ |
116 |
|
(${EGREEN} " Installing "${EWHITE}"yoda headers";${RESET}) |
117 |
|
(cd $(BASEDIR)/event/ && make distclean) |
118 |
|
rm -rf $(PAM_INC)/yoda/ |
119 |
|
cp -rf $(BASEDIR)/event/ $(PAM_INC)/yoda |
120 |
|
cp -rf $(PAM_LIB)/libyoda.so $(BASEDIR)/event/ |
121 |
|
(${EGREEN}"") |
122 |
|
(cd YodaProfiler && make forceinstall) |
123 |
|
endif |