Drop the generated libvirt_c.c from the sources
[ocaml-libvirt.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 MAKENSIS        = @MAKENSIS@
24
25 OCAMLDOC        = @OCAMLDOC@
26 OCAMLDOCFLAGS   := -html -sort
27
28 SUBDIRS         = libvirt examples
29
30 all opt depend install-opt install-byte:
31         for d in $(SUBDIRS); do \
32           $(MAKE) -C $$d $@; \
33           if [ $$? -ne 0 ]; then exit 1; fi; \
34         done
35
36 clean:
37         for d in . $(SUBDIRS); do \
38           (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \
39         done
40         rm -f libvirt/libvirt_c.c
41         rm -f examples/list_domains
42         rm -f examples/node_info
43         rm -f examples/get_cpu_stats
44         rm -f examples/domain_events
45         rm -f examples/get_all_domain_stats
46
47 distclean: clean
48         rm -f config.h config.log config.status configure
49         rm -rf autom4te.cache
50         rm -f META
51         rm -f libvirt/libvirt_version.ml
52         rm -f Makefile
53         rm -f Make.rules
54         rm -f libvirt/Makefile
55         rm -f examples/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 # Windows installer (requires NSIS).
69
70 WININSTALLER := $(PACKAGE)-$(VERSION).exe
71
72 ifneq ($(MAKENSIS),)
73 wininstaller: $(WININSTALLER)
74
75 $(WININSTALLER): wininstaller.nsis all opt
76         "$(MAKENSIS)" \
77           //DPACKAGE=$(PACKAGE) //DVERSION=$(VERSION) \
78           //DOUTFILE=$@ $<
79         ls -l $@
80 endif
81
82 # Update configure and rerun.
83
84 configure: force
85         autoreconf
86         CFLAGS=-g \
87           ./configure \
88           --enable-debug=yes --with-libvirt=/home/rjones/local
89
90 # Distribution.
91
92 dist: ChangeLog
93         $(MAKE) check-manifest
94         rm -rf $(PACKAGE)-$(VERSION)
95         mkdir $(PACKAGE)-$(VERSION)
96         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
97         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
98         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
99         rm -rf $(PACKAGE)-$(VERSION)
100         ls -l $(PACKAGE)-$(VERSION).tar.gz
101
102 check-manifest:
103         git ls-files | sort > .check-manifest; \
104         sort MANIFEST > .orig-manifest; \
105         diff -u .orig-manifest .check-manifest; rv=$$?; \
106         rm -f .orig-manifest .check-manifest; \
107         exit $$rv
108
109 ChangeLog:
110         hg log --style changelog > $@.new
111         mv $@.new $@
112
113 # Do a release (update the website).
114
115 release: configure
116         $(MAKE) release_stage_2
117
118 release_stage_2: clean all opt doc dist
119         $(MAKE) release_stage_3
120
121 WEBSITE = ../redhat/websites
122
123 release_stage_3:
124         rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css}
125         cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/
126         cp README $(WEBSITE)/ocaml-libvirt/README.txt
127         cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt
128
129 # Upload to main website.
130
131 upload:
132         cd $(WEBSITE)/ocaml-libvirt && \
133         scp ChangeLog.txt index.html README.txt Screenshot*.png \
134           libvirt.org:/data/www/libvirt.org/ocaml && \
135         scp css/*.css \
136           libvirt.org:/data/www/libvirt.org/ocaml/css/ && \
137         scp html/*.html html/*.css \
138           libvirt.org:/data/www/libvirt.org/ocaml/html/
139         scp $(PACKAGE)-$(VERSION).tar.gz libvirt.org:/data/ftp/libvirt/ocaml/
140
141 # Upload Windows binary installer to main website.
142
143 winupload:
144         scp $(WININSTALLER) libvirt.org:/data/ftp/libvirt/ocaml/
145
146 force:
147
148 .PHONY: all opt depend install clean distclean configure dist check-manifest \
149         release release_stage_2 release_stage_3 force