Skip to content
Browse files

Update build system based on lessons learned.

  • Loading branch information...
1 parent d85593f commit 638c9d36acd7f22ec2a054e864f8e7d778994ca9 @stesla committed Dec 16, 2008
Showing with 19 additions and 14 deletions.
  1. 0 ebin/.keep
  2. +18 −13 src/Makefile.am
  3. +1 −1 src/clusterl.app.in
View
0 ebin/.keep
No changes.
View
31 src/Makefile.am
@@ -1,18 +1,23 @@
app = clusterl
-erlfiles = $(wildcard *.erl)
-beamdir = $(ERLANG_INSTALL_LIB_DIR)/$(app)-$(VERSION)/ebin
-beam_DATA = $(erlfiles:%.erl=%.beam)
-app_DATA = $(app).app
-appdir = $(beamdir)
-CLEANFILES = $(beam_DATA) $(app_DATA)
+
+appdir = $(ERLANG_INSTALL_LIB_DIR)/$(app)-$(VERSION)
+ebindir = $(appdir)/ebin
+
+erl_files = $(wildcard *.erl)
+
+beam_files = $(erl_files:%.erl=../ebin/%.beam)
+app_files = ../ebin/$(app).app
+ebin_DATA = $(beam_files) $(app_files)
+
+CLEANFILES = $(ebin_DATA)
ERLCFLAGS = @ERLCFLAGS@ +debug_info
-SUFFIXES = .erl .beam
-.erl.beam:
- $(ERLC) $(ERLCFLAGS) -b beam $<
+do_subst = $(SED) -e 's|[@]VERSION[@]|$(VERSION)|g'
+
+../ebin/%.beam: %.erl
+ $(ERLC) $(ERLCFLAGS) -b beam -o ../ebin $<
-clusterl.app: clusterl.app.in
- $(SED) -e 's|[@]VERSION[@]|$(VERSION)|g' \
- -e 's|[@]MODULES[@]|$(beam_DATA:%.beam=%,)|g' -e 's/,]}/]}/' \
- < $< > $@
+../ebin/$(app).app: modules = $(erl_files:%.erl=%,)
+../ebin/$(app).app: $(app).app.in Makefile
+ $(do_subst) -e 's|[@]modules[@]|$(modules)|g' -e 's/,]}/]}/' < $< > $@
View
2 src/clusterl.app.in
@@ -2,7 +2,7 @@
{application, clusterl,
[{description, "Clusterl Agent"},
{vsn, "@VERSION@"},
- {modules, [@MODULES@]},
+ {modules, [@modules@]},
{registered, [clusterl_link_sup,
clusterl_network,
clusterl_radio,

0 comments on commit 638c9d3

Please sign in to comment.
Something went wrong with that request. Please try again.