192b02715ec316b1fedfa93fe481f703a912f5f8
[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
24 HAVE_PERLDOC    = @HAVE_PERLDOC@
25
26 TOOLS           = uname dmesg
27
28 SUBDIRS         = lib $(TOOLS)
29
30 ifeq ($(HAVE_PERLDOC),perldoc)
31 TARGETS         += virt-mem.1 virt-mem.txt $(TOOLS:%=virt-%.1)
32 endif
33
34 all install: $(TARGETS)
35         for d in $(SUBDIRS) po; do \
36           $(MAKE) -C $$d $@; \
37           if [ $$? -ne 0 ]; then exit 1; fi; \
38         done
39
40 depend doc:
41         for d in $(SUBDIRS); do \
42           $(MAKE) -C $$d $@; \
43           if [ $$? -ne 0 ]; then exit 1; fi; \
44         done
45
46 clean:
47         for d in . $(SUBDIRS); do \
48           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
49             *.so *.opt *~ *.dll *.exe *.annot core); \
50         done
51         for d in po; do \
52           (cd $$d; rm -f *~); \
53         done
54         rm -f uname/virt-uname
55         rm -f dmesg/virt-dmesg
56
57 distclean: clean
58         rm -f config.h config.log config.status configure
59         rm -rf autom4te.cache
60         rm -f Makefile
61         rm -f virt-df/Makefile
62
63 # Manual page.
64
65 ifeq ($(HAVE_PERLDOC),perldoc)
66 virt-mem.1: virt-mem.pod
67         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
68           $< > $@
69
70 virt-mem.txt: virt-mem.pod
71         pod2text $< > $@
72
73 virt-%.1:
74         echo '.so man1/virt-mem.1' > $@
75 endif
76
77 # Distribution.
78
79 dist:
80         $(MAKE) check-manifest
81         rm -rf $(PACKAGE)-$(VERSION)
82         mkdir $(PACKAGE)-$(VERSION)
83         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
84         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
85         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
86         rm -rf $(PACKAGE)-$(VERSION)
87         ls -l $(PACKAGE)-$(VERSION).tar.gz
88
89 check-manifest:
90         hg manifest | sort > .check-manifest; \
91         sort MANIFEST > .orig-manifest; \
92         diff -u .orig-manifest .check-manifest; rv=$$?; \
93         rm -f .orig-manifest .check-manifest; \
94         exit $$rv
95
96 .PHONY: all opt depend install clean distclean configure dist check-manifest \
97         release release_stage_2 release_stage_3 force