summaryrefslogtreecommitdiffstats
path: root/cpgx/Makefile
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2009-06-02 14:31:21 -0500
committerDavid Teigland <teigland@redhat.com>2009-06-02 14:33:05 -0500
commitdf2f314bdd152fa6622a7374b2ee2366e83655e7 (patch)
treec43c46f5c1ce9c923f70d8a59c9aecdba4a73945 /cpgx/Makefile
parentde35a795c61d339211f00119127a8e31fdab6fc8 (diff)
downloaddct-stuff-df2f314bdd152fa6622a7374b2ee2366e83655e7.tar.gz
dct-stuff-df2f314bdd152fa6622a7374b2ee2366e83655e7.tar.xz
dct-stuff-df2f314bdd152fa6622a7374b2ee2366e83655e7.zip
cpgx: version and build stuff
copying various build-related stuff from Nate, http://fedorapeople.org/gitweb?p=nstraz/public_git/gxpp.git Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'cpgx/Makefile')
-rw-r--r--cpgx/Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/cpgx/Makefile b/cpgx/Makefile
index 6a13264..ecca21a 100644
--- a/cpgx/Makefile
+++ b/cpgx/Makefile
@@ -12,6 +12,9 @@ LDFLAGS := -L/usr/lib/openais
endif
endif
+VER=$(shell cat VERSION)
+CFLAGS += -DVERSION=\"$(VER)\"
+
all: cpgx
cpgx: cpgx.o
@@ -24,6 +27,28 @@ clean:
rm -f *.o cpgx
install: all
- install cpgx /usr/bin
-
+ install cpgx $(DESTDIR)/usr/bin
+
+VERSION := $(shell cat VERSION)
+
+ifdef DIST
+ RPMDEFS := -D "dist $(DIST)"
+endif
+
+tarfiles := cpgx.c list.h cpgx.spec Makefile VERSION
+tarball := cpgx-$(VERSION).tar.gz
+
+# requires git tag of the release be made first,
+# e.g. git tag -a cpgx-v1.0 -m "release 1.0"
+
+$(tarball): $(tarfiles)
+ -$(RM) $@
+ git archive --format=tar --prefix=cpgx-$(VERSION)/ cpgx-v$(VERSION) | gzip > $@
+
+tarball: $(tarball)
+
+rpm: $(tarball) $(tarfiles)
+ rpmbuild -ta $< $(RPMDEFS)
+srpm: $(tarball) $(tarfiles)
+ rpmbuild -ts $< $(RPMDEFS)