-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmakefile
More file actions
58 lines (48 loc) · 1.74 KB
/
Copy pathmakefile
File metadata and controls
58 lines (48 loc) · 1.74 KB
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
56
57
58
INSTALL_PATH?=/usr/local/CTBangBang/
SCRIPT_PATH?=/usr/bin/
SRC_DIR=$(shell pwd)/
all: rebuild
rebuild:
mkdir -p src/obj
$(MAKE) -C src ../ctbangbang
install:
ifneq ($(USER),root)
@echo Please run with sudo
else
@echo Source directory is: ${SRC_DIR}.
@echo By default, the CTBB executable and support files
@echo are installed in:
@echo
@echo ${INSTALL_PATH}
@echo
@echo A script, ctbb_recon, will placed in ${SCRIPT_PATH} that should be used
@echo that should be used to execute reconstructions.
@echo
@echo After installation, type "ctbb_recon --help" for more information.
mkdir -p ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}include ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}prms ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}resources ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}src ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}ctbangbang ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}README.md ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}makefile ${INSTALL_PATH}
cp -v -u -r ${SRC_DIR}LICENSE.md ${INSTALL_PATH}
# Create our execution script
@echo Creating execution script ${SCRIPT_PATH}ctbb_recon...
touch ${SCRIPT_PATH}ctbb_recon
chmod +x ${SCRIPT_PATH}ctbb_recon
@echo "#!/bin/bash" > ${SCRIPT_PATH}ctbb_recon
@echo ${INSTALL_PATH}ctbangbang \"\$$\@\" >> ${SCRIPT_PATH}ctbb_recon
@echo "exit_status=\$$?" >> ${SCRIPT_PATH}ctbb_recon
@echo "if [ \$$exit_status -eq 0 ]" >> ${SCRIPT_PATH}ctbb_recon
@echo "then" >> ${SCRIPT_PATH}ctbb_recon
@echo notify-send \"Reconstruction completed\" >> ${SCRIPT_PATH}ctbb_recon
@echo "else" >> ${SCRIPT_PATH}ctbb_recon
@echo notify-send \"Reconstruction FAILED\" >> ${SCRIPT_PATH}ctbb_recon
@echo "fi" >> ${SCRIPT_PATH}ctbb_recon
@echo "exit \$$exit_status" >> ${SCRIPT_PATH}ctbb_recon
endif
.PHONY: all clean
clean:
$(MAKE) -C src clean