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