-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
88 lines (67 loc) · 2.1 KB
/
GNUmakefile
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
#==============================================================================
# File : GNUmakefile
# Purpose : The eburg makefile.
# Author : [email protected]
# License : BSD
# Created : 2007-08-30 13:34:34 j
# Modified : $Id: GNUmakefile,v 1.1.1.1 2008/08/07 16:31:33 j Exp $
#==============================================================================
# Configurables
PREFIX = /opt/lib/erlang
# Variables
PROGRAM = eburg
VERSION = 0.6
DIRS = include src
DISTFILES = GNUmakefile LICENSE MANUAL NEWS README bin/ doc/ ebin/ include/ src/ t/
DISTNAME = $(PROGRAM)-$(VERSION)
INSTALL = $(PREFIX)/$(PROGRAM)
# Build Targets
.PHONY: all clean distclean clobber test
all: src/eburg_lexer.erl src/eburg_parser.erl
cd src && erl -make all
src/eburg_lexer.erl: src/eburg_lexer.xrl
cd src && erl -noshell -eval "leex:file(eburg_lexer)" -s erlang halt
src/eburg_parser.erl: src/eburg_parser.yrl
cd src && erlc eburg_parser.yrl
clean: clobber
distclean: clobber
clobber:
rm -f `find . -name "*.beam"`
rm -f `find . -name "erl_crash.dump"`
rm -f src/eburg_lexer.erl
rm -f src/eburg_parser.erl
rm -f TAGS
test:
cd t && ./test.sh -v
# Utility Targets
.PHONY: doc check fluff dist tarball tags install uninstall
# doc: clobber
# erl -noshell -s edoc files `ls $(DIRS) | grep .[eh]rl` -s erlang halt
# @for d in $(DIRS); \
# do \
# cd $$d && mv *.html ../doc; \
# done
check: all
dialyzer --verbose -c ebin
fluff:
find include src -name "*.[eyx]rl" | xargs awk 'length > 80'
find include src -name "*.[eyx]rl" | xargs awk '/[ ]+$$/'
dist: tarball
tarball: clobber src/eburg_lexer.erl
mkdir $(DISTNAME)
cp -R $(DISTFILES) $(DISTNAME)
tar -s /.*CVS.*// -czvf $(DISTNAME).tar.gz $(DISTNAME)
rm -rf $(DISTNAME)
md5 $(DISTNAME).tar.gz
tags: clobber
erl -noshell -s tags dirs $(DIRS) -s erlang halt
install: all
mkdir $(INSTALL)
cp -R $(DISTFILES) $(INSTALL)
@echo "You might want to add a line similar to\n\
code:add_pathz(\"$(INSTALL)/ebin\")\nto your ~/.erlang file."
uninstall:
rm -rf $(INSTALL)
# Local Variables:
# mode: makefile-gmake
# End: