-DIRS = ocaml matita
-# gTopLevel searchEngine mathql_test hxp
-DIRS_BYTE = $(patsubst %,%.byte,$(DIRS))
-DIRS_OPT = $(patsubst %,%.opt,$(DIRS))
-DIRS_CLEAN = $(patsubst %,%.clean,$(DIRS))
-all: byte
-byte: $(DIRS_BYTE)
-opt: $(DIRS_OPT)
-world: byte opt
-clean: $(DIRS_CLEAN)
-%.byte:
- $(MAKE) -C $*/ all
-%.opt:
- $(MAKE) -C $*/ opt
-%.clean:
- $(MAKE) -C $*/ clean
-.PHONY: all byte opt world clean
+BASENAME = matita
+VERSION = 0.1.0
+
+NULL =
+DISTDIR = $(BASENAME)-$(VERSION)
+CLEAN_ON_DIST = \
+ ocaml/license \
+ $(NULL)
+EXTRA_DIST = \
+ dist/AUTHORS \
+ dist/COPYING \
+ dist/INSTALL \
+ dist/README \
+ dist/ChangeLog \
+ $(NULL)
+
+dist: export mktarball
+distcheck: dist extract build
+
+export:
+ rm -rf $(DISTDIR)
+ mkdir $(DISTDIR)
+ svn export ocaml $(DISTDIR)/ocaml
+ svn export matita $(DISTDIR)/matita
+ (cd $(DISTDIR) && rm -f $(CLEAN_ON_DIST))
+
+mktarball:
+ tar cvzf $(DISTDIR).tar.gz $(DISTDIR)
+
+.PHONY: dist export mktarball distcheck extract build
+