Fixed library name in baselibs.conf
[platform/upstream/libaio.git] / Makefile
1 NAME=libaio
2 SPECFILE=$(NAME).spec
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")
7
8 DESTDIR=
9 prefix=/usr
10 includedir=$(prefix)/include
11 libdir=$(prefix)/lib
12 libdevdir=$(prefix)/lib
13
14 default: all
15
16 all:
17         @$(MAKE) -C src
18
19 install:
20         @$(MAKE) -C src install \
21           DESTDIR=$(DESTDIR) \
22           prefix=$(prefix) \
23           includedir=$(includedir) \
24           libdir=$(libdir) \
25           libdevdir=$(libdevdir)
26
27 check:
28         @$(MAKE) -C harness check
29
30 partcheck: all
31         @$(MAKE) -C harness partcheck
32
33 clean:
34         @$(MAKE) -C src clean
35         @$(MAKE) -C harness clean
36
37 tag-archive:
38         @cvs -Q tag -F $(CVSTAG)
39
40 create-archive: tag-archive
41         @rm -rf /tmp/$(NAME)
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 
48         @echo " "
49         @echo "The final archive is ./$(NAME)-$(VERSION).tar.gz."
50
51 archive: clean tag-archive create-archive
52
53 srpm: create-archive
54         $(RPMBUILD) --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" --nodeps -bs $(SPECFILE)