-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
42 lines (35 loc) · 1.27 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
# -*- Makefile -*-
# --------------------------------------------------------------------
.PHONY: generate check clean dist
NAME := libjc
# --------------------------------------------------------------------
generate:
$(MAKE) -C src
$(MAKE) -C proof generate
# --------------------------------------------------------------------
check: generate
$(MAKE) -C proof check
# --------------------------------------------------------------------
clean:
$(MAKE) -C src clean
$(MAKE) -C proof clean
# --------------------------------------------------------------------
dist: generate
rm -rf $(NAME) $(NAME).tar.gz
./scripts/distribution $(NAME) MANIFEST
tar -czf $(NAME).tar.gz --owner=0 --group=0 $(NAME) && rm -rf $(NAME)
# --------------------------------------------------------------------
distcheck: dist
tar -xof $(NAME).tar.gz
set -x; \
$(MAKE) -C $(NAME) generate \
&& $(MAKE) -C $(NAME) check \
&& $(MAKE) -C $(NAME) dist \
&& mkdir $(NAME)/dist1 $(NAME)/dist2 \
&& ( cd $(NAME)/dist1 && tar -xof ../$(NAME).tar.gz ) \
&& ( cd $(NAME)/dist2 && tar -xof ../../$(NAME).tar.gz ) \
&& diff -rq $(NAME)/dist1 $(NAME)/dist2 \
|| exit 1
rm -rf $(NAME)
@echo "$(NAME) is ready for distribution" | \
$(SED) -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'