703d14eec0e68609400e9a66b2decb9e6a4ebc66
[virt-top.git] / Makefile.in
1 # ocaml-libvirt
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
18 PACKAGE         = @PACKAGE_NAME@
19 VERSION         = @PACKAGE_VERSION@
20
21 INSTALL         = @INSTALL@
22
23 OCAMLDOC        = @OCAMLDOC@
24 OCAMLDOCFLAGS   := -html -sort
25
26 SUBDIRS         = @subdirs@
27
28 all opt depend install:
29         for d in $(SUBDIRS); do \
30           $(MAKE) -C $$d $@; \
31           if [ $$? -ne 0 ]; then exit 1; fi; \
32         done
33
34 clean:
35         for d in . $(SUBDIRS); do \
36           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll core); \
37         done
38         rm -f examples/list_domains
39         rm -f mlvirsh/mlvirsh
40         rm -f mlvirtmanager/mlvirtmanager
41         rm -f virt-top/virt-top
42         rm -f virt-df/virt-df
43
44 distclean: clean
45         rm -f config.h config.log config.status configure
46         rm -rf autom4te.cache
47         rm -f META
48         rm -f libvirt/libvirt_version.ml
49         rm -f Makefile
50         rm -f libvirt/Makefile
51         rm -f examples/Makefile
52         rm -f mlvirsh/Makefile
53         rm -f mlvirtmanager/Makefile
54         rm -f virt-top/Makefile
55         rm -f virt-df/Makefile
56
57 # Developer documentation (in html/ subdirectory).
58
59 ifneq ($(OCAMLDOC),)
60 doc:
61         rm -rf html
62         mkdir html
63         -cd libvirt; \
64         $(OCAMLDOC) $(OCAMLDOCFLAGS) -d ../html \
65           libvirt.{ml,mli} libvirt_version.{ml,mli}
66 endif
67
68 # Update configure and rerun.
69
70 configure: force
71         autoreconf
72         CFLAGS=-g \
73           ./configure \
74           --enable-debug=yes --with-libvirt=/home/rjones/local
75
76 # Distribution.
77
78 dist:
79         $(MAKE) check-manifest
80         rm -rf $(PACKAGE)-$(VERSION)
81         mkdir $(PACKAGE)-$(VERSION)
82         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
83         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
84         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
85         rm -rf $(PACKAGE)-$(VERSION)
86         ls -l $(PACKAGE)-$(VERSION).tar.gz
87
88 check-manifest:
89         hg manifest | sort > .check-manifest; \
90         sort MANIFEST > .orig-manifest; \
91         diff -u .orig-manifest .check-manifest; rv=$$?; \
92         rm -f .orig-manifest .check-manifest; \
93         exit $$rv
94
95 # Do a release (update the website).
96
97 release: configure
98         $(MAKE) release_stage_2
99
100 release_stage_2: clean all opt doc dist
101         $(MAKE) release_stage_3
102
103 WEBSITE = ../redhat/websites
104
105 release_stage_3:
106         rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css}
107         cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/
108         cp README $(WEBSITE)/ocaml-libvirt/README.txt
109         cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt
110 #       cp virt-top/virt-top.txt $(WEBSITE)/virt-top/
111 #       cp ChangeLog $(WEBSITE)/virt-top/ChangeLog.txt
112
113 # Upload to main website.
114
115 upload:
116         cd $(WEBSITE)/ocaml-libvirt && \
117         scp ChangeLog.txt index.html README.txt Screenshot*.png \
118           libvirt.org:/data/www/libvirt.org/ocaml && \
119         scp css/*.css \
120           libvirt.org:/data/www/libvirt.org/ocaml/css/ && \
121         scp html/*.html html/*.css \
122           libvirt.org:/data/www/libvirt.org/ocaml/html/
123         scp $(PACKAGE)-$(VERSION).tar.gz libvirt.org:/data/ftp/libvirt/ocaml/
124
125 force:
126
127 .PHONY: all opt depend install clean distclean configure dist check-manifest \
128         release release_stage_2 release_stage_3 force