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 \
28 -package bitstring.syntax,extlib,libvirt,gettext,xml-light \
30 -syntax bitstring.syntax
32 OCAMLDOCFILES = $(wildcard lib/*.ml) $(wildcard lib/*.mli)
34 HAVE_PERLDOC = @HAVE_PERLDOC@
36 TOOLS = uname dmesg ps ifconfig
39 SUBDIRS_NOT_PO = lib $(TOOLS) mem extract/fedora-koji extract/codegen
40 SUBDIRS = $(SUBDIRS_NOT_PO) po
42 ifeq ($(HAVE_PERLDOC),perldoc)
43 MANPAGES = virt-mem.1 $(TOOLS:%=virt-%.1)
44 TEXTMANPAGES = virt-mem.txt
47 TARGETS = $(MANPAGES) $(TEXTMANPAGES)
50 for d in $(SUBDIRS_NOT_PO); do \
52 if [ $$? -ne 0 ]; then exit 1; fi; \
56 for d in $(SUBDIRS); do \
58 if [ $$? -ne 0 ]; then exit 1; fi; \
62 for d in $(SUBDIRS_NOT_PO); do \
64 if [ $$? -ne 0 ]; then exit 1; fi; \
68 for d in . $(SUBDIRS); do \
69 (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
70 *.so *.opt *~ *.dll *.exe *.annot core); \
72 rm -f uname/virt-uname
73 rm -f dmesg/virt-dmesg
78 rm -f config.h config.log config.status configure
83 # Rebuild the PO files.
88 # Download distribution kernels (warning: takes AGES).
92 ../extract/fedora-koji/fedora-koji-download-kernels.opt
94 # Rebuild the generated kernel struct parsers from the kerneldb.
96 update-kernel-structs:
97 extract/codegen/compile-kerneldb.opt kernels lib
99 # Developer documentation (in html/ subdirectory).
102 ifneq ($(OCAMLDOCFILES),)
106 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html $(OCAMLDOCFILES)
112 ifeq ($(HAVE_PERLDOC),perldoc)
113 virt-mem.1: virt-mem.pod
114 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
117 virt-mem.txt: virt-mem.pod
121 echo '.so man1/virt-mem.1' > $@
124 $(MKDIR_P) $(DESTDIR)$(mandir)/man1
125 $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/
136 $(MAKE) check-manifest
137 rm -rf $(PACKAGE)-$(VERSION)
138 mkdir $(PACKAGE)-$(VERSION)
139 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
140 hg log --style changelog > $(PACKAGE)-$(VERSION)/ChangeLog
141 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
142 $(INSTALL) -m 0644 config.h.in $(PACKAGE)-$(VERSION)/
143 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
144 rm -rf $(PACKAGE)-$(VERSION)
145 mkdir $(PACKAGE)-$(VERSION)
146 mkdir $(PACKAGE)-$(VERSION)/kernels
147 $(INSTALL) -m 0644 kernels/*.data* kernels/*.info \
148 $(PACKAGE)-$(VERSION)/kernels/
149 tar zcf $(PACKAGE)-kerneldb-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
150 rm -rf $(PACKAGE)-$(VERSION)
151 ls -l $(PACKAGE)-$(VERSION).tar.gz
152 ls -l $(PACKAGE)-kerneldb-$(VERSION).tar.gz
156 grep -Ev 'kernels/.*\.(data|info).*' | \
157 sort > .check-manifest; \
158 sort MANIFEST > .orig-manifest; \
159 diff -u .orig-manifest .check-manifest; rv=$$?; \
160 rm -f .orig-manifest .check-manifest; \
163 .PHONY: all opt depend install clean distclean configure dist check-manifest \
164 release release_stage_2 release_stage_3 force