3 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
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.
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.
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
19 PACKAGE = @PACKAGE_NAME@
20 VERSION = @PACKAGE_VERSION@
24 datarootdir = @datarootdir@
27 OCAMLDOCFLAGS = -html -sort -package bitstring,extlib -I lib
29 OCAMLDOCFILES = lib/virt_mem_utils.ml \
30 lib/virt_mem_mmap.mli \
31 lib/virt_mem_types.ml \
32 lib/virt_mem_ksyms.mli \
33 lib/virt_mem_kallsyms.mli \
36 HAVE_PERLDOC = @HAVE_PERLDOC@
38 TOOLS = uname dmesg ps
41 SUBDIRS_NOT_PO = lib $(TOOLS) mem
42 SUBDIRS = $(SUBDIRS_NOT_PO) po
44 ifeq ($(HAVE_PERLDOC),perldoc)
45 MANPAGES = virt-mem.1 $(TOOLS:%=virt-%.1)
46 TEXTMANPAGES = virt-mem.txt
49 TARGETS = $(MANPAGES) $(TEXTMANPAGES)
52 for d in $(SUBDIRS); do \
54 if [ $$? -ne 0 ]; then exit 1; fi; \
58 for d in $(SUBDIRS); do \
60 if [ $$? -ne 0 ]; then exit 1; fi; \
64 for d in $(SUBDIRS_NOT_PO); do \
66 if [ $$? -ne 0 ]; then exit 1; fi; \
70 for d in . $(SUBDIRS); do \
71 (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
72 *.so *.opt *~ *.dll *.exe *.annot core); \
74 rm -f uname/virt-uname
75 rm -f dmesg/virt-dmesg
80 rm -f config.h config.log config.status configure
85 # Developer documentation (in html/ subdirectory).
88 ifneq ($(OCAMLDOCFILES),)
92 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html $(OCAMLDOCFILES)
98 ifeq ($(HAVE_PERLDOC),perldoc)
99 virt-mem.1: virt-mem.pod
100 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
103 virt-mem.txt: virt-mem.pod
107 echo '.so man1/virt-mem.1' > $@
110 $(MKDIR_P) $(DESTDIR)$(mandir)/man1
111 $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/
122 $(MAKE) check-manifest
123 rm -rf $(PACKAGE)-$(VERSION)
124 mkdir $(PACKAGE)-$(VERSION)
125 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
126 hg log --style changelog > $(PACKAGE)-$(VERSION)/ChangeLog
127 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
128 $(INSTALL) -m 0644 config.h.in $(PACKAGE)-$(VERSION)/
129 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
130 rm -rf $(PACKAGE)-$(VERSION)
131 ls -l $(PACKAGE)-$(VERSION).tar.gz
134 hg manifest | sort > .check-manifest; \
135 sort MANIFEST > .orig-manifest; \
136 diff -u .orig-manifest .check-manifest; rv=$$?; \
137 rm -f .orig-manifest .check-manifest; \
140 .PHONY: all opt depend install clean distclean configure dist check-manifest \
141 release release_stage_2 release_stage_3 force