forked from jasmin-lang/jasmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (51 loc) · 1.68 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! -*- Makefile -*-
# --------------------------------------------------------------------
UNAME_S := $(shell uname -s)
SED ?= sed
DISTDIR := jasmin
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR := $(PREFIX)/bin
LIBDIR := $(PREFIX)/lib
INSTALL ?= install
# --------------------------------------------------------------------
.PHONY: all build check clean dist distcheck
all: build
build:
$(MAKE) -C proofs all
$(MAKE) -C compiler CIL
$(MAKE) -C compiler all
check:
$(MAKE) -C eclib check
clean:
$(MAKE) -C proofs clean
$(MAKE) -C compiler clean
install:
$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR)
$(INSTALL) -m 0755 -T compiler/jasminc.native $(DESTDIR)$(BINDIR)/jasminc
$(INSTALL) -m 0755 -d $(DESTDIR)$(LIBDIR)/jasmin/easycrypt
$(INSTALL) -m 0644 -t $(DESTDIR)$(LIBDIR)/jasmin/easycrypt eclib/*.ec
$(MAKE) -C proofs install
uninstall:
rm -f $(DESTDIR)$(BINDIR)/jasminc
rm -rf $(DESTDIR)$(LIBDIR)/jasmin
dist:
rm -rf jasmin jasmin.tar.gz
./scripts/distribution $(DISTDIR) MANIFEST
rm -rf jasmin/proofs/logic
if [ -x scripts/anonymize ]; then SED=$(SED) scripts/anonymize; fi
$(SED) -i -e "/logic/d" jasmin/proofs/_CoqProject
tar -czf jasmin.tar.gz --owner=0 --group=0 jasmin && rm -rf jasmin
distcheck: dist
tar -xof $(DISTDIR).tar.gz
set -x; \
$(MAKE) -C $(DISTDIR) \
&& $(MAKE) -C $(DISTDIR) dist \
&& mkdir $(DISTDIR)/dist1 $(DISTDIR)/dist2 \
&& ( cd $(DISTDIR)/dist1 && tar -xof ../$(DISTDIR).tar.gz ) \
&& ( cd $(DISTDIR)/dist2 && tar -xof ../../$(DISTDIR).tar.gz ) \
&& diff -rq $(DISTDIR)/dist1 $(DISTDIR)/dist2 \
|| exit 1
rm -rf $(DISTDIR)
@echo "$(DISTDIR) is ready for distribution" | \
$(SED) -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'