Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Convert erlando for the public umbrella
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Sackman committed Apr 27, 2011
1 parent bb80b6d commit 7934ba2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 117 deletions.
11 changes: 7 additions & 4 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
syntax: glob
*.beam
*~
deps.mk
\.beam$
~$
^build/
^dist/
^cover/
^erl_crash.dump$
^c_src/libhstcp.so$
53 changes: 1 addition & 52 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
DEPS_FILE:=deps.mk
SOURCE_DIR:=src
TEST_SOURCE_DIR:=test/src
EBIN_DIR:=ebin
INCLUDE_DIR:=include

SOURCES=$(wildcard $(SOURCE_DIR)/*.erl)
TEST_SOURCES=$(wildcard $(TEST_SOURCE_DIR)/*.erl)
BEAM_TARGETS=$(patsubst %.erl, $(EBIN_DIR)/%.beam, $(notdir $(SOURCES) $(TEST_SOURCES)))
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.hrl)

ERLC_OPTS=-I $(INCLUDE_DIR) -o $(EBIN_DIR) -Wall -v +debug_info -Duse_specs

all: $(BEAM_TARGETS)

$(DEPS_FILE): $(SOURCES) $(TEST_SOURCES) $(INCLUDES)
rm -f $@
echo $(subst : ,:,$(foreach FILE,$^,$(FILE):)) | escript generate_deps $@ $(EBIN_DIR)

$(EBIN_DIR)/%.beam: $(SOURCE_DIR)/%.erl | $(DEPS_FILE) $(EBIN_DIR)
erlc $(ERLC_OPTS) -pa $(EBIN_DIR) $<

$(EBIN_DIR)/%.beam: $(TEST_SOURCE_DIR)/%.erl | $(DEPS_FILE) $(EBIN_DIR)
erlc $(ERLC_OPTS) -pa $(EBIN_DIR) $<

$(EBIN_DIR):
mkdir $@

clean:
rm -f $(EBIN_DIR)/*.beam
rm -f $(DEPS_FILE)

run: all
erl -pa $(EBIN_DIR)

# Note that all targets which depend on clean must have clean in their
# name. Also any target that doesn't depend on clean should not have
# clean in its name, unless you know that you don't need any of the
# automatic dependency generation for that target (eg cleandb).

# We want to load the dep file if *any* target *doesn't* contain
# "clean" - i.e. if removing all clean-like targets leaves something

ifeq "$(MAKECMDGOALS)" ""
TESTABLEGOALS:=$(.DEFAULT_GOAL)
else
TESTABLEGOALS:=$(MAKECMDGOALS)
endif

ifneq "$(strip $(patsubst clean%,,$(patsubst %clean,,$(TESTABLEGOALS))))" ""
-include $(DEPS_FILE)
endif
include ../umbrella.mk
17 changes: 17 additions & 0 deletions ebin/erlando.app
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{application, hstcp,
[{description, "Syntax extensions for Erlang"},
{vsn, "%%VSN%%"},
{modules, [cut
erlando
error_m
identity_m
list_m
maybe_m
monad
monad_plus
omega_m
state_t
test_m
]},
{registered, []},
{applications, []}]}.
61 changes: 0 additions & 61 deletions generate_deps

This file was deleted.

1 change: 1 addition & 0 deletions package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STANDALONE_TEST_COMMANDS:=test_do:test() test_cut:test()

0 comments on commit 7934ba2

Please sign in to comment.