-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
99 lines (87 loc) · 3.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
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
93
94
95
96
97
98
99
# Nothing for you here! This is simply for me, so that I'll can do some
# general CVS stuff easily.
#
DATE := $(shell date +"%b %e %Y")
TMPDIR := $(shell tempfile)
VERSION := $(shell cat .version | sed 's@\ .*@@')
INSTDIR := $(TMPDIR)/phpQLAdmin-$(VERSION)
DESTDIR := $(TMPDIR)/phpqladmin-$(VERSION)
# Make a unified diff over the changes from the last version...
diff:
@(VERSION=`cat .version.old`; \
MAJOR=`expr substr $$VERSION 1 1`; \
MINOR=`expr substr $$VERSION 3 1`; \
LEVEL=`expr substr $$VERSION 5 2`; \
TAG="REL_`echo $$MAJOR`_`echo $$MINOR`_`echo $$LEVEL`"; \
echo cvs rdiff: $$TAG; \
cvs rdiff -ur $$TAG phpQLAdmin; \
)
tag:
@(VERSION=`cat .version | sed 's@ .*@@'`; \
MAJOR=`expr substr $$VERSION 1 1`; \
MINOR=`expr substr $$VERSION 3 1`; \
LEVEL=`expr substr $$VERSION 5 2`; \
OLDLV=`expr $$LEVEL - 1`; \
echo "$$MAJOR.$$MINOR.$$OLDLV" > .version.old; \
echo "$$MAJOR.$$MINOR.$$LEVEL" > .version; \
echo -n "We are now at version "; \
cat < .version; \
TAG="REL_`echo $$MAJOR`_`echo $$MINOR`_`echo $$LEVEL`"; \
echo -n $(TAG) > .tag; \
echo cvs tag: $$TAG; \
cvs tag -RF $$TAG; \
)
install: $(INSTDIR)
@(echo -n "Instdir: $(INSTDIR): "; find | cpio -p $(INSTDIR))
excludelist:
@(cd $(TMPDIR); \
find -type d -name CVS -exec find {} \; \
| sed 's@\./@@' > exclude.list; \
find -type f -name '.cvsignore' -o -name 'README.cvs' \
-o -name '*.new' -o -name '*.orig' -o -name '*~' \
-o -name '.#*' -o -name '*.jpg' -o -name '*.gif' \
-o -name '*.png' | sed 's@\./@@' >> exclude.list; \
cat exclude.list | sort | uniq > new; \
echo $(INSTDIR)/Makefile $(INSTDIR)/.version.old \
$(INSTDIR)/manual $(INSTDIR)/include/config.inc \
$(INSTDIR)/phpQLadmin.log $(INSTDIR)/doc/README.Monitor \
$(INSTDIR)/.DEBUG_ME >> new; \
mv new exclude.list; \
cat exclude.list | xargs rm -rf)
tarball: install excludelist
@(echo -n "Tarball 1: $(TMPDIR)/phpQLAdmin-$(VERSION).tar.gz: "; \
cd $(TMPDIR) && tar -cz --exclude=README.cvs -f phpQLAdmin-$(VERSION).tar.gz phpQLAdmin-$(VERSION); \
echo "done."; \
echo -n "Tarball 2: $(TMPDIR)/phpQLAdmin-$(VERSION).tar.bz2: "; \
cd $(TMPDIR) && tar -cj --exclude=README.cvs --exclude=debian \
-f phpQLAdmin-$(VERSION).tar.bz2 phpQLAdmin-$(VERSION); \
echo "done."; \
echo -n "ZIP file: $(TMPDIR)/phpQLAdmin-$(VERSION).zip: "; \
cd $(TMPDIR) && zip -r phpQLAdmin-$(VERSION).zip phpQLAdmin-$(VERSION) > /dev/null; \
echo "done.")
debian: install
@(mv $(INSTDIR) $(DESTDIR); \
cd $(DESTDIR); \
debuild; \
echo "Files is in: "$(DESTDIR))
release: changes tag tarball debian
@(cp $(TMPDIR)/phpQLAdmin-$(VERSION).tar.gz /web/phpqladmin/; \
cp $(TMPDIR)/phpQLAdmin-$(VERSION).tar.bz2 /web/phpqladmin/; \
cp $(TMPDIR)/phpQLAdmin-$(VERSION).zip /web/phpqladmin/; \
cp CHANGES /web/phpqladmin/CHANGES_devel.txt; \
cp $(TMPDIR)/*.deb *.dsc *.tar.gz *.changes /web/phpqladmin)
$(INSTDIR):
@rm -f $(TMPDIR) && mkdir -p $(INSTDIR)
changes: version
@( \
echo "Date: $(DATE)"; \
cat CHANGES | sed "s@TO BE ANNOUNCED@Release \($(DATE)\)@" > CHANGES.new; \
mv CHANGES.new CHANGES; \
cvs commit -m "New release - `cat .version | sed 's@ .*@@'`" CHANGES .version; \
)
version:
@(cat .version | sed 's@ (.*@@' > .version.new; \
mv .version.new .version)
clean:
@(find -name '*~' -o -name '.*~' -o -name '.#*' -o -name '#*' | \
xargs --no-run-if-empty rm)