Skip to content
This repository
Newer
Older
100644 65 lines (48 sloc) 1.263 kb
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
1 # Makefile for LFE
bb7ff101 »
2010-12-30 Cleanup rebar usage
2 # This simple Makefile uses rebar to compile/clean if it
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
3 # exists, else does it explicitly.
277c981e »
2008-08-23 Initial release.
4
53a6fa55 »
2011-06-16 Improve usage of erlc
5 BINDIR = ebin
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
6 SRCDIR = src
7 INCDIR = include
8 DOCDIR = doc
9 EMACSDIR = emacs
10
11 VPATH = $(SRCDIR)
12
13 ERLCFLAGS = -W0 +debug_info
53a6fa55 »
2011-06-16 Improve usage of erlc
14 ERLC = erlc
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
15
16 ## The .erl and .beam files
17 SRCS = $(notdir $(wildcard $(SRCDIR)/*.erl))
18 EBINS = $(SRCS:.erl=.beam)
19
20 ## Where we install LFE, in the ERL_LIBS directory.
704ac7f6 »
2010-08-25 Fixed Makefile to actually do compilation.
21 INSTALLDIR = $(ERL_LIBS)/lfe
277c981e »
2008-08-23 Initial release.
22
53a6fa55 »
2011-06-16 Improve usage of erlc
23 .SUFFIXES: .erl .beam
24
25 $(BINDIR)/%.beam: %.erl
26 $(ERLC) -I $(INCDIR) -o $(BINDIR) $(ERLCFLAGS) $<
27
28 $(SRCDIR)/%.erl: %.xrl
29 $(ERLC) -o $(SRCDIR) $<
30
31 $(SRCDIR)/%.erl: %.yrl
32 $(ERLC) -o $(SRCDIR) $<
33
277c981e »
2008-08-23 Initial release.
34 all: compile docs
35
53a6fa55 »
2011-06-16 Improve usage of erlc
36 .PHONY: compile erlc_compile install docs clean
37
38 ## Compile using rebar if it exists else using make
277c981e »
2008-08-23 Initial release.
39 compile:
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
40 if which -s rebar; \
41 then rebar compile; \
53a6fa55 »
2011-06-16 Improve usage of erlc
42 else $(MAKE) $(MFLAGS) erlc_compile; \
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
43 fi
44
53a6fa55 »
2011-06-16 Improve usage of erlc
45 ## Compile using erlc
46 erlc_compile: $(addprefix $(BINDIR)/, $(EBINS))
47
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
48 install:
bb7ff101 »
2010-12-30 Cleanup rebar usage
49 if [ "$$ERL_LIBS" != "" ]; \
53a6fa55 »
2011-06-16 Improve usage of erlc
50 then mkdir -p $(INSTALLDIR)/$(BINDIR) ; \
51 cp -pPR $(BINDIR) $(INSTALLDIR); \
704ac7f6 »
2010-08-25 Fixed Makefile to actually do compilation.
52 cp -pPR $(EMACSDIR) $(INSTALLDIR); \
9bb19fda »
2011-06-05 Add simple include-lib macro
53 cp -pPR $(INCDIR) $(INSTALLDIR); \
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
54 else exit 1; \
55 fi
277c981e »
2008-08-23 Initial release.
56
57 docs:
58
59 clean:
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
60 if which -s rebar; \
61 then rebar clean; \
53a6fa55 »
2011-06-16 Improve usage of erlc
62 else rm -rf $(BINDIR)/*.beam; \
dc3cc4e0 »
2010-05-27 Fix Makefile and add Emakefile and lfe.app.
63 fi
277c981e »
2008-08-23 Initial release.
64 rm -rf erl_crash.dump
Something went wrong with that request. Please try again.