From 667d8b09d0ebfb39c66bff489e44945782a50a10 Mon Sep 17 00:00:00 2001 From: James Clark Date: Sun, 30 Jun 2019 16:31:39 +0700 Subject: [PATCH] Add Makefile to build dist --- lang/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lang/Makefile diff --git a/lang/Makefile b/lang/Makefile new file mode 100644 index 00000000..eac3ea15 --- /dev/null +++ b/lang/Makefile @@ -0,0 +1,19 @@ +# This is intended to be run on POSIX with GNU Make +VERSION:=$(shell sed -n -e '/^]/s/.* \(20[12][0-9]R[0-9][0-9]*\)<.*/\1/p' spec.html) + +DISTDIR=ballerina-lang-spec-$(VERSION) +ZIPFILE=$(DISTDIR).zip +DISTFILES=spec.html lib/versions.json \ + lib/array.bal lib/decimal.bal lib/error.bal lib/float.bal lib/future.bal \ + lib/int.bal lib/map.bal lib/object.bal lib/stream.bal lib/string.bal \ + lib/table.bal lib/typedesc.bal lib/value.bal lib/xml.bal + +$(ZIPFILE): $(DISTFILES) + test -d $(DISTDIR) || mkdir $(DISTDIR) + tar cf - $(DISTFILES) | (cd $(DISTDIR); tar xf -) + zip $(ZIPFILE) $(addprefix $(DISTDIR)/,$(DISTFILES)) + +clean: FORCE + -rm -fr $(DISTDIR) $(ZIPFILE) + +FORCE: \ No newline at end of file