File: Makefile

package info (click to toggle)
network-config 0.2-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 376 kB
  • ctags: 136
  • sloc: perl: 5,976; makefile: 148; sh: 90
file content (72 lines) | stat: -rw-r--r-- 2,140 bytes parent folder | download
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
#VERSION=subversion-$(shell date +%d-%m-%y)
VERSION=0.2
DIST_NAME=network-config-${VERSION}
PREFIX=$(DESTDIR)/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 ./network-config.pl ${PREFIX}/bin/network-config
	cp ./default-icon.png ${PREFIX}/share/network-config/
	chmod +x ${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}/bin/network-config
	rm -f ${PREFIX}/share/network-config/default-icon.png
	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";