-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
73 lines (61 loc) · 1.88 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PHP=/usr/local/bin/php
CLOC=/usr/local/bin/cloc
ECHO=/bin/echo
ZIP=/usr/bin/zip
DIRNAME=$(notdir $(shell pwd))
BASENAME=$(basename $(shell pwd))
OS := $(shell uname)
os:
@ $(ECHO) -n "Operating System : "
@ $(ECHO) $(OS)
cloc:
@ $(ECHO) "Statistiques"
@ $(CLOC) --exclude-dir=divers ./
reset_all: reset_user reset_data reset_session
reset_user:
@ $(ECHO) -n "Reset de la table 'user' : "
@ cd divers/outils/; $(PHP) database.php -u
@ $(ECHO) "OK"
reset_data:
@ $(ECHO) -n "Reset de la table 'data' : "
@ cd divers/outils/; $(PHP) database.php -d
@ $(ECHO) "OK"
reset_session:
@ $(ECHO) -n "Reset de la table 'session' : "
@ cd divers/outils/; $(PHP) database.php -s
@ $(ECHO) "OK"
check_str:
@ echo "Check des chaines"
@ cd divers/outils/; $(PHP) langue.php -s
check_dir:
@ $(ECHO) -n "Check des repertoires : "
@ chmod 777 web/upload web/upload/foo
@ chmod 777 web/cache
@ $(ECHO) "OK"
clean_all: clean_cache clean_file
clean_cache:
@ $(ECHO) -n "Suppression des fichiers cache : "
@ if [ -d "web/theme/carbone/dist/scripts/cache" ]; then cd "web/theme/carbone/dist/scripts/cache"; rm -f *; fi
@ if [ -d "web/theme/carbone/dist/styles/cache" ]; then cd "web/theme/carbone/dist/styles/cache"; rm -f *; fi
@ $(ECHO) "OK"
clean_file:
@ $(ECHO) -n "Suppression des fichiers inutiles : "
@ rm -f $(DIRNAME).zip
ifeq ($(OS), Darwin)
@ find ./ -type f | grep .DS_Store | xargs rm
@ find . -iname "._*" | xargs rm
@ find . -iname "*~" | xargs rm
@ find ./ -type f | grep Thumbs.db | xargs rm
else
@ find ./ -type f | grep .DS_Store | xargs -r rm
@ find . -iname "._*" | xargs -r rm
@ find . -iname "*~" | xargs -r rm
@ find ./ -type f | grep Thumbs.db | xargs -r rm
endif
@ $(ECHO) "OK"
zip: clean_all
@ $(ECHO) -n "Creation de l'archive Zip : "
@ rm -f $(DIRNAME).zip
@ cd ..; $(ZIP) -r /tmp/$(DIRNAME).zip $(DIRNAME) > /dev/null
@ mv /tmp/$(DIRNAME).zip $(BASENAME)
@ $(ECHO) "OK"