-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
100 lines (88 loc) · 2.86 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# $Id$
#
# Copyright (c) 2008 Timothy Bourke (University of NSW and NICTA)
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the "BSD License" which is distributed with the
# software in the file LICENSE.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the BSD
# License for more details.
#
MAKE=make
.include "src/Makefile"
FREEBSD=urpal-$(URPAL_VERSION).x86-freebsd
LINUX=urpal-$(URPAL_VERSION).x86-linux
WIN32=urpal-$(URPAL_VERSION).x86-win32
SRCDIST=urpal-$(URPAL_VERSION)
CHECKBIN=readelf -e src/urpal | sed -n -e 's| *OS/ABI: *\(.*\)|\1|p'
SKIPSVN=-type d -name '.svn' -prune -type f -o \! -name .svn -a
STRIPDOT=sed -ne 's:^\./\(.*\):\1:p'
all:
(cd src; make)
distfiles: freebsd linux win32 src
freebsd: dist/$(FREEBSD)
linux: dist/$(LINUX)
win32: dist/$(WIN32)
src: dist/$(SRCDIST)
dist/$(SRCDIST): dist
@make -C ./src clobber
@make -C ./doc clobber
@make -C ./src version.sml lexfiles grmfiles
-@mkdir dist/$(SRCDIST)
.for srcdir in ./src ./tests ./doc
@(for d in `find $(srcdir) $(SKIPSVN) -type d | $(STRIPDOT)`; do \
mkdir dist/$(SRCDIST)/$$d; \
done)
@(for f in `find $(srcdir) $(SKIPSVN) -type f | $(STRIPDOT)`; do \
cp $$f dist/$(SRCDIST)/$$f; \
done)
@(for f in `find $(srcdir) $(SKIPSVN) -type l | $(STRIPDOT)`; do \
cp -RP $$f dist/$(SRCDIST)/$$f; \
done)
.endfor
@cp README LICENSE dist/$(SRCDIST)/
tar czf dist/$(SRCDIST).tar.gz -C dist $(SRCDIST)
dist/$(FREEBSD): dist
make -C ./src clobber
make -C ./src withmlton
test "`$(CHECKBIN)`" = 'UNIX - FreeBSD'
-mkdir dist/$(FREEBSD)
cp src/urpal doc/urpal.1 README LICENSE dist/$(FREEBSD)
(echo 'dtd_path="flat-1_1.dtd"'; \
echo 'graphviz {'; \
echo ' path="/usr/local"'; \
echo ' engine=neato'; \
echo '}') > dist/$(FREEBSD)/urpalrc
tar czf dist/$(FREEBSD).tar.gz -C dist $(FREEBSD)
dist/$(WIN32): dist
make -C ./doc urpal.1.pdf
make -C ./src clobber
make -C ./src mingw32
-mkdir dist/$(WIN32)
cp src/urpal.exe doc/urpal.1.pdf dist/$(WIN32)
(echo 'dtd_path="flat-1_1.dtd"'; \
echo 'graphviz {'; \
echo ' path="C:\Program Files\Graphviz2.16"'; \
echo ' engine=neato'; \
echo '}') | unix2dos > dist/$(WIN32)/urpalrc
cat README | unix2dos > dist/$(WIN32)/README.txt
cat LICENSE | unix2dos > dist/$(WIN32)/LICENSE
(cd dist; zip -r $(WIN32).zip $(WIN32))
dist/$(LINUX): dist
# make -C ./src clobber
# make -C ./src withmlton
test "`$(CHECKBIN)`" = 'UNIX - Linux'
-mkdir dist/$(LINUX)
cp src/urpal doc/urpal.1 README LICENSE dist/$(LINUX)
(echo 'dtd_path="flat-1_1.dtd"'; \
echo 'graphviz {'; \
echo ' path="/usr"'; \
echo ' engine=neato'; \
echo '}') > dist/$(LINUX)/urpalrc
tar czf dist/$(LINUX).tar.gz -C dist $(LINUX)
dist:
mkdir dist