3 VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
4 RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE))
5 CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
6 RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
10 includedir=$(prefix)/include
12 libdevdir=$(prefix)/lib
20 @$(MAKE) -C src install \
23 includedir=$(includedir) \
25 libdevdir=$(libdevdir)
28 @$(MAKE) -C harness check
31 @$(MAKE) -C harness partcheck
35 @$(MAKE) -C harness clean
38 @cvs -Q tag -F $(CVSTAG)
40 create-archive: tag-archive
42 @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) $(NAME) || echo GRRRrrrrr -- ignore [export aborted]
43 @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION)
44 @cd /tmp; tar czSpf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)
45 @rm -rf /tmp/$(NAME)-$(VERSION)
46 @cp /tmp/$(NAME)-$(VERSION).tar.gz .
47 @rm -f /tmp/$(NAME)-$(VERSION).tar.gz
49 @echo "The final archive is ./$(NAME)-$(VERSION).tar.gz."
51 archive: clean tag-archive create-archive
54 $(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE)