-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
84 lines (75 loc) · 1.77 KB
/
makefile
File metadata and controls
84 lines (75 loc) · 1.77 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# TOP path
#
PROJ=conpro2
TOP=/home/sbosse/proj/$(PROJ)
LOG=$(TOP)/update.log
#
# Utils
#
CP=cp
MKDIR=mkdir
TAR=tar
RM=rm
VUM=
REV=/usr/bin/revision
DATE := $(shell date)
SHELL = /bin/bash
ARCH := /Cloud/Revision/conpro2/$(PROJ).diff*.tgz
STATE := /home/sbosse/revision/$(PROJ).state
DATE := $(shell perl -MPOSIX=strftime -le 'print strftime("%y%m%d%H%M", localtime((stat shift)[9]))' $(STATE))
DATES := $(shell perl -MPOSIX=strftime -le 'print strftime("%y%m%d@%H%M", localtime((stat shift)[9]))' $(STATE))
help:
@echo "Targets: [backup,diff,sync]"
check: $(ARCH)
$(RM) -f update
@cd $(TOP)/..;echo "Last sync: $(DATES)";for file in $(ARCH);\
do\
F=$${file##*/};\
F1=$${F%.*};\
F2=$${F1##*.};\
DATE2=$${F2/@/};\
if [[ $$DATE2 > $(DATE) ]];\
then\
echo "Apply update $$file ? [y/n]";\
read answer;\
if [ "X$$answer" = "Xn" ];\
then\
echo "Skipping $$file"; \
else\
touch $(TOP)/update;\
echo "Applying update $$file!";\
gtar -U -zxvf $$file;\
fi;\
fi;\
done;\
cd $(TOP);\
if test -f update;\
then\
$(VUM) $(REV) -freeze;\
touch diff;\
touch update;\
fi
all:
cd $(TOP)/doc; build all install
cd $(TOP)/lib; build all install
cd $(TOP)/toolset; build all install
cd $(TOP)/build/ml; build all install
cd $(TOP)/scripts; build all install
cd $(TOP)/build/bin; build all install
clean:
cd $(TOP)/lib; build clean
cd $(TOP)/toolset; build clean
cd $(TOP)/build/ml; build clean
sync:
$(VUM) $(REV) -freeze
touch diff
touch update
backup:
$(VUM) $(REV) -backup
touch diff
touch update
diff:
$(VUM) $(REV) -compare
touch diff
touch update