Version 0.2.3 for release.
[virt-mem.git] / Makefile.in
1 # virt-mem
2 # @configure_input@
3 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18
19 PACKAGE         = @PACKAGE_NAME@
20 VERSION         = @PACKAGE_VERSION@
21
22 INSTALL         = @INSTALL@
23 datarootdir     = @datarootdir@
24 mandir          = @mandir@
25
26 HAVE_PERLDOC    = @HAVE_PERLDOC@
27
28 TOOLS           = uname dmesg
29
30 ifeq ($(HAVE_PERLDOC),perldoc)
31 MANPAGES        = virt-mem.1 $(TOOLS:%=virt-%.1)
32 TEXTMANPAGES    = virt-mem.txt
33 endif
34
35 TARGETS         = $(MANPAGES) $(TEXTMANPAGES)
36
37 all: $(TARGETS)
38         for d in lib $(TOOLS) po; do \
39           $(MAKE) -C $$d $@; \
40           if [ $$? -ne 0 ]; then exit 1; fi; \
41         done
42
43 install: install-man
44         for d in lib $(TOOLS) po; do \
45           $(MAKE) -C $$d $@; \
46           if [ $$? -ne 0 ]; then exit 1; fi; \
47         done
48
49 depend doc:
50         for d in lib $(TOOLS); do \
51           $(MAKE) -C $$d $@; \
52           if [ $$? -ne 0 ]; then exit 1; fi; \
53         done
54
55 clean:
56         for d in . lib $(TOOLS); do \
57           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
58             *.so *.opt *~ *.dll *.exe *.annot core); \
59         done
60         for d in po; do \
61           (cd $$d; rm -f *~); \
62         done
63         rm -f uname/virt-uname
64         rm -f dmesg/virt-dmesg
65
66 distclean: clean
67         rm -f config.h config.log config.status configure
68         rm -rf autom4te.cache
69         rm -f Makefile
70         rm -f virt-df/Makefile
71
72 # Manual page.
73
74 ifeq ($(HAVE_PERLDOC),perldoc)
75 virt-mem.1: virt-mem.pod
76         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
77           $< > $@
78
79 virt-mem.txt: virt-mem.pod
80         pod2text $< > $@
81
82 virt-%.1:
83         echo '.so man1/virt-mem.1' > $@
84
85 install-man:
86         $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/
87
88 else
89
90 install-man:
91
92 endif
93
94 # Distribution.
95
96 dist:
97         $(MAKE) check-manifest
98         rm -rf $(PACKAGE)-$(VERSION)
99         mkdir $(PACKAGE)-$(VERSION)
100         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
101         hg log --style changelog > $(PACKAGE)-$(VERSION)/ChangeLog
102         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
103         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
104         rm -rf $(PACKAGE)-$(VERSION)
105         ls -l $(PACKAGE)-$(VERSION).tar.gz
106
107 check-manifest:
108         hg manifest | sort > .check-manifest; \
109         sort MANIFEST > .orig-manifest; \
110         diff -u .orig-manifest .check-manifest; rv=$$?; \
111         rm -f .orig-manifest .check-manifest; \
112         exit $$rv
113
114 .PHONY: all opt depend install clean distclean configure dist check-manifest \
115         release release_stage_2 release_stage_3 force