forked from Conedy/Conedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecompileConedy
executable file
·55 lines (32 loc) · 1.95 KB
/
recompileConedy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/make -sf
#This file is not meant to be called by users. It is an internal script, which recompiles Conedy in case new node dynamics have been added.
#What it does:
#
#1. link the global config file to ${HOME}/.config/conedy in case no config file is found there.
#2. Check if the version number oin the build directory ${buildDir} is different from the one in the global installation in ${dirSrc}
#3. Check if the addedNodes directory containss different or more nodes than were used for the last compilation in ${buildDir}.
#In case 2 or 3 is positive, conedy is rebuild. The script then returns 0
#Otherwise no recompilation is necessary and the script returns 1.
${HOME}/.config/conedy/config.h: # if the config-file of the user does not exist, we link the global config file and start again.
mkdir -p ${HOME}/.config/conedy
[ -f /etc/conedy.config ] && ln -s /etc/conedy.config ${HOME}/.config/conedy/config.h && recompileConedy
include ${HOME}/.config/conedy/config.h # the config-file is included such that we have access to the variables for directories
#conedy_recompile:
doit: ${todo}
conedy-root:
condor:
python-conedy:
python-conedy-root:
documentation:
conedy-src: recompile
%.recompile: ${HOME}/.config/conedy/config.h
name=`mktemp`; make -sC ${dirSrc} version > $$name; \
( [ -f ${buildDir}/Makefile ] && diff $$name ${buildDir}/version ) || make -C ${dirSrc} copySrc
TMP=`mktemp`; \
cd ${buildDir}; sum addedNodes/*.cfg > $$TMP; \
[ -d ${addedDir} ] && [ "$$(ls -A ${addedDir})" ] && (find ${addedDir} -name "*.cfg" | sort | xargs sum >> $$TMP) || true ; \
diff $$TMP ${buildDir}/addedNodes.sum.old || touch ${buildDir}/recompilation_conedy_started ${buildDir}/recompilation_python-conedy_started ${buildDir}/recompilation_condor_started
[ -f ${buildDir}/recompilation_$*_started ]
make -C ${buildDir} $*.recompile
# ln -s ${CONEDYFILES} ${buildDir}
.PHONY: recompile conedy python-conedy documentation conedy-src