+VERSION = 0.0.1
+DISTDIR = uwobo-$(VERSION)
REQUIRES = http gdome2 gdome2-xslt pcre unix threads
COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
OCAMLC = ocamlfind ocamlc $(COMMONOPTS)
OCAMLOPT = ocamlfind ocamlopt $(COMMONOPTS)
OCAMLDEP = ocamlfind ocamldep $(COMMONOPTS)
-MODULES = uwobo_common uwobo_styles uwobo_logger uwobo_engine uwobo
+MODULES = uwobo_common uwobo_styles uwobo_logger uwobo_engine
OBJS = $(patsubst %,%.cmo,$(MODULES))
OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
-all: opt
+all: world
byte: uwobo
opt: uwobo.opt
world: byte opt
$(OCAMLC) -c $<
uwobo.cmx: uwobo.ml
$(OCAMLOPT) -c $<
-uwobo: $(OBJS)
+uwobo: $(OBJS) uwobo.ml
$(OCAMLC) -linkpkg -thread -o $@ $^
-uwobo.opt: $(OBJSOPT)
+uwobo.opt: $(OBJSOPT) uwobo.ml
$(OCAMLOPT) -linkpkg -thread -o $@ $^
+distclean: clean
clean:
rm -f *.cm[aiox] *.o uwobo{,.opt}
+dist: distclean depend
+ mkdir $(DISTDIR)/
+ cp \
+ $(patsubst %, %.ml, $(MODULES)) \
+ $(patsubst %, %.mli, $(MODULES)) \
+ uwobo.ml \
+ Makefile .depend \
+ $(DISTDIR)/
+ tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
+ rm -rf $(DISTDIR)/
.PHONY: all byte opt world depend clean