| 1 |
.PHONY = permissions archives compress clean |
| 2 |
|
| 3 |
CPF = compress.txt |
| 4 |
AR = archive |
| 5 |
|
| 6 |
all: permissions archives compress |
| 7 |
|
| 8 |
permissions: |
| 9 |
cd $(AR); \ |
| 10 |
chmod 755 permissions/executable_file.txt; \ |
| 11 |
chmod 700 permissions/private_executable_file.txt; \ |
| 12 |
chmod 444 permissions/readonly_file.txt; \ |
| 13 |
chmod 700 permissions/private_folder; \ |
| 14 |
chmod 600 permissions/private_folder/private_file.txt; |
| 15 |
|
| 16 |
## archives |
| 17 |
## TODO: separate |
| 18 |
archives: |
| 19 |
cd $(AR); \ |
| 20 |
tar czf ../$(AR).tar.gz *; \ |
| 21 |
tar cjf ../$(AR).tar.bz2 *; \ |
| 22 |
tar cf ../$(AR).tar *; \ |
| 23 |
zip -q -r ../$(AR) .; \ |
| 24 |
jar cMf ../$(AR).jar .; \ |
| 25 |
find . -depth ! -path . -print | cpio --quiet -o > ../$(AR).cpio; \ |
| 26 |
7z a -t7z ../$(AR).7z . > /dev/null; |
| 27 |
|
| 28 |
## compress |
| 29 |
compress: $(CPF).gz $(CPF).lzma $(CPF).bz2 $(CPF).xz |
| 30 |
|
| 31 |
$(CPF).gz: |
| 32 |
gzip -c $(CPF) > $@ |
| 33 |
|
| 34 |
$(CPF).bz2: |
| 35 |
bzip2 -c $(CPF) > $@ |
| 36 |
|
| 37 |
$(CPF).lzma: |
| 38 |
lzma -z -c $(CPF) > $@ |
| 39 |
|
| 40 |
$(CPF).xz: |
| 41 |
xz -z -c $(CPF) > $@ |
| 42 |
|
| 43 |
## clean |
| 44 |
clean: clean-compress clean-archives |
| 45 |
|
| 46 |
clean-compress: |
| 47 |
rm -f $(CPF).* |
| 48 |
|
| 49 |
clean-archives: |
| 50 |
rm -f $(AR).* |