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