14
14
# V2.1: Added CCby license. Restructured a bit.
15
15
# V2.0: Added 32-bit target for 64 bits environment.
16
16
17
- VERSION := 4.1.$(shell date +% Y.% m.% d)
18
- CFLAGS := -std=c11 -Wall -O2 -DNDEBUG -g2 -DVERSION=\"$(VERSION ) \" $(CFLAGS ) -Wno-deprecated-declarations
17
+ VERSION := 4.1
18
+ REL := $(shell git log -1 --format=% cd --date=format:% Y% m% d || date +% Y% m% d)
19
+ CFLAGS := -std=c11 -Wall -O2 -DNDEBUG -g2 -DVERSION=\"$(VERSION ) .$(REL ) \" $(CFLAGS ) -Wno-deprecated-declarations
19
20
CPPFLAGS := ` pkg-config --cflags gtk+-2.0 ` $(CPPFLAGS )
20
21
LDLIBS := ` pkg-config --libs gtk+-2.0 ` $(LDLIBS )
21
22
23
+ $(warn $(DESTDIR))
24
+
22
25
targets := gatotray
23
26
24
27
all : $(targets )
@@ -28,14 +31,13 @@ gatotray: gatotray.o
28
31
gatotray.i386 : gatotray.o.i386
29
32
$(LD ) -m32 -o $@ $^ $(LDLIBS )
30
33
31
- install : gatotray
32
- strip $^
33
- install -vD $^ /usr/local/bin
34
- install -vD gatotray.xpm /usr/share/icons
35
- install -vD gatotray.desktop /usr/share/applications/gatotray.desktop
34
+ install : gatotray gatotray.xpm gatotray.desktop
35
+ install -svDt $(DESTDIR ) /usr/bin/ gatotray
36
+ install -vDt $(DESTDIR ) /usr/share/icons/ gatotray.xpm
37
+ install -vDt $(DESTDIR ) /usr/share/applications/ gatotray.desktop
36
38
37
- deb : gatotray-$(VERSION ) .deb
38
- gatotray-$(VERSION ) .deb : gatotray gatotray.xpm gatotray.desktop Debian-Control
39
+ deb : gatotray-$(VERSION ) .$( REL ) . deb
40
+ gatotray-$(VERSION ) .$( REL ) . deb : gatotray gatotray.xpm gatotray.desktop Debian-Control
39
41
install -vD gatotray root/usr/bin/gatotray
40
42
strip root/usr/bin/gatotray
41
43
install -vD gatotray.desktop root/usr/share/applications/gatotray.desktop
@@ -45,9 +47,17 @@ gatotray-$(VERSION).deb: gatotray gatotray.xpm gatotray.desktop Debian-Control
45
47
sed -i ' s/^Version:.*/Version: $(VERSION)/' root/DEBIAN/control
46
48
dpkg -b root $@
47
49
48
- # Additional: .api file for SciTE users...
49
- .api : $(wildcard * .h)
50
- $(CC ) -E $(CPPFLAGS ) $^ | grep ' (' | sed ' s/^[^[:space:]]*[[:space:]]\+//' | sort| uniq > $@
50
+ Debian-Control : Makefile
51
+ sed -ie ' s/^Version:.*/Version: $(VERSION).$(REL)/' $@
52
+
53
+ PKGBUILD : Makefile
54
+ sed -ie ' s/^pkgver=.*/pkgver=$(VERSION)/' $@
55
+ sed -ie ' s/^pkgrel=.*/pkgrel=$(REL)/' $@
56
+
57
+ # Tarball for building distribution packages
58
+ tarball : gatotray-$(VERSION ) .$(REL ) .tar.gz
59
+ gatotray-$(VERSION ) .$(REL ) .tar.gz : Debian-Control PKGBUILD
60
+ git archive --prefix=gatotray-$(VERSION ) / -o $@ HEAD
51
61
52
62
53
63
# ## Magic rules follow
0 commit comments