ce2e803a429c5af49f082f71ca4f7118758c6e57
[virt-top.git] / Makefile.in
1 PACKAGE         = @PACKAGE_NAME@
2 VERSION         = @PACKAGE_VERSION@
3
4 INSTALL         = @INSTALL@
5
6 pkg_lablgtk2    = @pkg_lablgtk2@
7 pkg_curses      = @pkg_curses@
8 pkg_xml_light   = @pkg_xml_light@
9
10 OCAMLDOCFLAGS   := -html -sort
11
12 SUBDIRS         := libvirt examples mlvirsh
13
14 ifeq ($(pkg_lablgtk2),yes)
15 SUBDIRS         += mlvirtmanager
16 endif
17
18 ifeq ($(pkg_curses),yes)
19 SUBDIRS         += virt-top
20 endif
21
22 ifeq ($(pkg_xml_light),yes)
23 SUBDIRS         += virt-df
24 endif
25
26 all opt depend install:
27         for d in $(SUBDIRS); do \
28           $(MAKE) -C $$d $@; \
29           if [ $$? -ne 0 ]; then exit 1; fi; \
30         done
31
32 clean:
33         for d in . $(SUBDIRS); do \
34           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ core); \
35         done
36         rm -f examples/list_domains
37         rm -f mlvirsh/mlvirsh
38         rm -f mlvirtmanager/mlvirtmanager
39         rm -f virt-top/virt-top
40
41 distclean: clean
42         rm -f config.h config.log config.status configure
43         rm -rf autom4te.cache
44         rm -f META
45         rm -f libvirt/libvirt_version.ml
46         rm -f Makefile
47         rm -f libvirt/Makefile
48         rm -f examples/Makefile
49         rm -f mlvirsh/Makefile
50         rm -f mlvirtmanager/Makefile
51         rm -f virt-top/Makefile
52         rm -f virt-df/Makefile
53
54 # Developer documentation (in html/ subdirectory).
55
56 doc:
57         rm -rf html
58         mkdir html
59         -cd libvirt; \
60         ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d ../html \
61           libvirt.{ml,mli} libvirt_version.{ml,mli}
62
63 # Update configure and rerun.
64
65 configure: force
66         autoreconf
67         CFLAGS=-g \
68           ./configure \
69           --enable-debug=yes --with-libvirt=/home/rjones/local
70
71 # Distribution.
72
73 dist:
74         $(MAKE) check-manifest
75         rm -rf $(PACKAGE)-$(VERSION)
76         mkdir $(PACKAGE)-$(VERSION)
77         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
78         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
79         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
80         rm -rf $(PACKAGE)-$(VERSION)
81         ls -l $(PACKAGE)-$(VERSION).tar.gz
82
83 check-manifest:
84         hg manifest | sort > .check-manifest; \
85         sort MANIFEST > .orig-manifest; \
86         diff -u .orig-manifest .check-manifest; rv=$$?; \
87         rm -f .orig-manifest .check-manifest; \
88         exit $$rv
89
90 # Do a release (update the website).
91
92 release: configure
93         $(MAKE) release_stage_2
94
95 release_stage_2: clean all opt doc dist
96         $(MAKE) release_stage_3
97
98 WEBSITE = ../redhat/et-website
99
100 release_stage_3:
101         rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css}
102         cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/
103         cp $(PACKAGE)-$(VERSION).tar.gz $(WEBSITE)/ocaml-libvirt/
104         cp README $(WEBSITE)/ocaml-libvirt/README.txt
105         cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt
106         cp virt-top/virt-top.txt $(WEBSITE)/virt-top/
107         cp ChangeLog $(WEBSITE)/virt-top/ChangeLog.txt
108
109 force:
110
111 .PHONY: all opt depend install clean distclean configure dist check-manifest \
112         release release_stage_2 release_stage_3 force