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