-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (50 loc) · 1.39 KB
/
Makefile
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
# Makefile minimaliste pour la sauvegarde du repertoire courant
#
# Les cibles suivantes creent un fichier compress'e et dat'e du r'ep'ertoire courant
# dans le r'ep'ertoire parent.
#
# tgz : fichier de suffixe .tgz (au format .tar.gz)
# tbz : idem, mais compresser avec bzip2
# zip : fichier au format zip
# arc : une des précédentes (valeur par défaut)
#
#
########################################################################
#
# Archivage du répertoire courant dans le répertoire parent
#
arc: tbz
# Compression avec gzip
tgz:
# $(MAKE) clean
date=`date +%Y%m%d-%Hh%Mmn` && \
lpath=`pwd` && \
bname=`basename $$lpath` && \
datename=$$bname-$$date && \
cd .. && \
cp -pR $$bname $$datename && \
tar cf - $$datename | gzip > $$datename.tgz && \
\rm -rf $$datename
# Compression avec bzip2
tbz:
# $(MAKE) clean
date=`date +%Y%m%d-%Hh%Mmn` && \
lpath=`pwd` && \
bname=`basename $$lpath` && \
datename=$$bname-$$date && \
cd .. && \
cp -pR $$bname $$datename && \
tar cf - $$datename | bzip2 > $$datename.tbz && \
\rm -rf $$datename
# Compression avec zip
zip:
# $(MAKE) clean
date=`date +%Y%m%d-%Hh%Mmn` && \
lpath=`pwd` && \
bname=`basename $$lpath` && \
datename=$$bname-$$date && \
cd .. && \
cp -pR $$bname $$datename && \
zip -r -y -o -q -9 $$datename.zip $$datename && \
\rm -rf $$datename
#./