File: Makefile

package info (click to toggle)
network-config 0.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 228 kB
  • ctags: 69
  • sloc: perl: 2,988; sh: 135; makefile: 119
file content (92 lines) | stat: -rw-r--r-- 3,121 bytes parent folder | download | duplicates (2)
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
85
86
87
88
89
90
91
92
#VERSION=subversion-$(shell date +%d-%m-%y)
VERSION=0.2
DIST_NAME=network-config-${VERSION}
PREFIX=/usr

all: compile

help:
	@echo "make run : run"
	@echo "make install : install (as root)"
	@echo "make uninstall : uninstall (as root)"
	@echo "make dist : create .tar.gz"

run:
	./network-config.pl

compile:
	@echo;
	@echo "You can type \"make install\" (as root) to install Network-config version ${VERSION}"
	@echo;

install:
	@echo "Installing Network-config version ${VERSION} :";
	@echo;
	mkdir -p ${PREFIX}/share/network-config
	cp ./Makefile ${PREFIX}/share/network-config/
	cp ./configure ${PREFIX}/share/network-config/
	cp ./network-config.pl ${PREFIX}/share/network-config/
	cp ./default-icon.png ${PREFIX}/share/network-config/
	cp ./AUTHORS ${PREFIX}/share/network-config/
	cp ./ChangeLog ${PREFIX}/share/network-config/
	cp ./COPYING ${PREFIX}/share/network-config/
	cp ./INSTALL ${PREFIX}/share/network-config/
	cp ./NEWS ${PREFIX}/share/network-config/
	cp ./README ${PREFIX}/share/network-config/
	cp ./TODO ${PREFIX}/share/network-config/
	chmod +x ${PREFIX}/share/network-config/network-config.pl
	ln -s -f ${PREFIX}/share/network-config/network-config.pl ${PREFIX}/bin/network-config
	@echo;
	@echo "Installation is finished.";
	@echo "You can type \"make uninstall\" if you wish to uninstall the program.";

uninstall:
	@echo "Uninstalling Network-config version ${VERSION} :";
	@echo;
	rm -f ${PREFIX}/share/network-config/network-config.pl
	rm -f ${PREFIX}/share/network-config/default-icon.png
	rm -f ${PREFIX}/bin/network-config
	rm -f ${PREFIX}/share/network-config/configure
	rm -f ${PREFIX}/share/network-config/Makefile
	rm -f ${PREFIX}/share/network-config/AUTHORS
	rm -f ${PREFIX}/share/network-config/ChangeLog
	rm -f ${PREFIX}/share/network-config/COPYING
	rm -f ${PREFIX}/share/network-config/INSTALL
	rm -f ${PREFIX}/share/network-config/NEWS
	rm -f ${PREFIX}/share/network-config/README
	rm -f ${PREFIX}/share/network-config/TODO
	rmdir ${PREFIX}/share/network-config;
	@echo;
	@echo "Uninstallation is finished.";
	@echo "Warning, the configuration settings are still there (usually in /etc/network-config/)";

dist:
	@echo "Creating distribution for Network-config version ${VERSION} :";
	@echo;
	rm -rf ./${DIST_NAME}
	mkdir -p ./${DIST_NAME}
	cp ./configure ./${DIST_NAME}
	chmod +x ./${DIST_NAME}/configure
	cp ./network-config.pl ./${DIST_NAME}
	cp ./default-icon.png ./${DIST_NAME}
	cp ./AUTHORS ./${DIST_NAME}
	cp ./ChangeLog ./${DIST_NAME}
	cp ./COPYING ./${DIST_NAME}
	cp ./INSTALL ./${DIST_NAME}
	cp ./NEWS ./${DIST_NAME}
	cp ./README ./${DIST_NAME}
	cp ./TODO ./${DIST_NAME}
	cp ./Makefile ./${DIST_NAME}
	tar czf ./${DIST_NAME}.tar.gz ./${DIST_NAME}
	rm -rf ./${DIST_NAME}	
	@echo;
	@echo "Distribution created with the name ${DIST_NAME}.tar.gz";

save:
	my_revision=1;\
	for rev in `ls ../saved/ | sed "s/network-config_//" | sort -n`;\
	do if [ $$rev -eq $$my_revision ]; then let "my_revision = $${rev}+1";\
	fi; done;\
	mkdir -p ../saved/network-config_$${my_revision};\
	cp -a ./* ../saved/network-config_$${my_revision};\
	echo "revision "$${my_revision}" saved";