Updated kerneldb.
[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 OCAMLDOCFLAGS   = -html -sort \
28                   -package bitstring,extlib,libvirt,gettext,xml-light \
29                   -I lib
30 OCAMLDOC        = @OCAMLDOC@
31 OCAMLDOCFILES   = $(wildcard lib/virt_*.mli) lib/kernel.mli
32
33 HAVE_PERLDOC    = @HAVE_PERLDOC@
34
35 TOOLS           = uname dmesg ps ifconfig
36 export TOOLS
37
38 SUBDIRS_NOT_PO  = lib $(TOOLS) mem extract/fedora-koji extract/codegen
39 SUBDIRS         = $(SUBDIRS_NOT_PO) po
40
41 ifeq ($(HAVE_PERLDOC),perldoc)
42 MANPAGES        = virt-mem.1 $(TOOLS:%=virt-%.1)
43 TEXTMANPAGES    = virt-mem.txt
44 endif
45
46 TARGETS         = $(MANPAGES) $(TEXTMANPAGES)
47
48 all: byte opt
49
50 byte opt: $(TARGETS)
51         for d in $(SUBDIRS_NOT_PO); do \
52           $(MAKE) -C $$d $@; \
53           if [ $$? -ne 0 ]; then exit 1; fi; \
54         done
55
56 install: install-man
57         for d in $(SUBDIRS); do \
58           $(MAKE) -C $$d $@; \
59           if [ $$? -ne 0 ]; then exit 1; fi; \
60         done
61
62 depend:
63         for d in $(SUBDIRS_NOT_PO); do \
64           $(MAKE) -C $$d $@; \
65           if [ $$? -ne 0 ]; then exit 1; fi; \
66         done
67
68 clean:
69         for d in . $(SUBDIRS); do \
70           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
71             *.so *.opt *~ *.dll *.exe *.annot core); \
72         done
73         rm -f lib/test_mmap
74         rm -f uname/virt-uname
75         rm -f dmesg/virt-dmesg
76         rm -f ps/virt-ps
77         rm -f mem/virt-mem
78
79 distclean: clean
80         rm -f config.h config.log config.status configure
81         rm -rf autom4te.cache
82         rm -f Makefile
83         rm -f */Makefile
84
85 # Rebuild the PO files.
86
87 update-po:
88         $(MAKE) -C po all
89
90 # Download distribution kernels (warning: takes AGES).
91
92 update-kerneldb:
93         cd kernels && \
94           ../extract/fedora-koji/fedora-koji-download-kernels.opt
95
96 # Rebuild the generated kernel struct parsers from the kerneldb.
97
98 update-kernel-structs:
99         extract/codegen/compile-kerneldb.opt kernels lib
100
101 # Developer documentation (in html/ subdirectory).
102
103 ifneq ($(OCAMLDOC),)
104 ifneq ($(OCAMLDOCFILES),)
105 doc:
106         rm -rf html
107         mkdir html
108         -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html $(OCAMLDOCFILES)
109 endif
110 endif
111
112 # Manual page.
113
114 ifeq ($(HAVE_PERLDOC),perldoc)
115 virt-mem.1: virt-mem.pod
116         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
117           $< > $@
118
119 virt-mem.txt: virt-mem.pod
120         pod2text $< > $@
121
122 virt-%.1:
123         echo '.so man1/virt-mem.1' > $@
124
125 install-man:
126         $(MKDIR_P) $(DESTDIR)$(mandir)/man1
127         $(INSTALL) -m 0644 $(MANPAGES) $(DESTDIR)$(mandir)/man1/
128
129 else
130
131 install-man:
132
133 endif
134
135 # Distribution.
136
137 dist:
138         $(MAKE) check-manifest
139         rm -rf $(PACKAGE)-$(VERSION)
140         mkdir $(PACKAGE)-$(VERSION)
141         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
142         hg log --style changelog > $(PACKAGE)-$(VERSION)/ChangeLog
143         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
144         $(INSTALL) -m 0644 config.h.in $(PACKAGE)-$(VERSION)/
145         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
146         rm -rf $(PACKAGE)-$(VERSION)
147         mkdir $(PACKAGE)-$(VERSION)
148         mkdir $(PACKAGE)-$(VERSION)/kernels
149         $(INSTALL) -m 0644 kernels/*.data* kernels/*.info \
150           $(PACKAGE)-$(VERSION)/kernels/
151         tar zcf $(PACKAGE)-kerneldb-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
152         rm -rf $(PACKAGE)-$(VERSION)
153         ls -l $(PACKAGE)-$(VERSION).tar.gz
154         ls -l $(PACKAGE)-kerneldb-$(VERSION).tar.gz
155
156 check-manifest:
157         hg manifest | \
158           grep -Ev 'kernels/.*\.(data|info).*' | \
159           sort > .check-manifest; \
160         sort MANIFEST > .orig-manifest; \
161         diff -u .orig-manifest .check-manifest; rv=$$?; \
162         rm -f .orig-manifest .check-manifest; \
163         exit $$rv
164
165 .PHONY: all opt depend install clean distclean configure dist check-manifest \
166         release release_stage_2 release_stage_3 force