Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 80 lines (60 sloc) 2.066 kb
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
VSN=2.0.27a
ERLC=/usr/bin/env erlc
ERL=/usr/bin/env erl
APPDIR= $(abspath ./_build/sinan/lib/sinan-$(VSN))
SRCDIR=src
TESTDIR=test
COPYDIRS= include src test
BEAMDIR=$(APPDIR)/ebin
SMOKETEST_DIR=$(CURDIR)/smoketests
PYPATH=$(PYTHONPATH):$(SMOKETEST_DIR)
BEHAVIOURS= src/sin_task.erl src/sin_dep_resolver.erl
RSYNC_OPTIONS=-vaz --delete
.SUFFIXES: .erl .beam .yrl

vpath %.erl src test

ERL_OBJ = $(patsubst src/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(SRCDIR)/*erl))
ERL_TEST_OBJ = $(patsubst test/%.erl,$(BEAMDIR)/%.beam, $(wildcard $(TESTDIR)/*erl))

all: main

setup:
for f in $(COPYDIRS) ; do \
mkdir -p $(APPDIR)/$$f ; \
rsync $(RSYNC_OPTIONS) $$f $(APPDIR); \
done
mkdir -p $(APPDIR)/ebin;
rsync $(RSYNC_OPTIONS) ebin/sinan.app $(APPDIR)/ebin/sinan.app

build_behaviours: $(BEHAVIOURS)
# make sure sin_task gets built first so its always available
$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
+warn_obsolete_guard \
+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $(BEHAVIOURS)

main: setup build_behaviours ${ERL_OBJ} ${ERL_TEST_OBJ}

$(BEAMDIR)/%.beam: %.erl
$(ERLC) -pa $(BEAMDIR) +warn_export_vars +warn_export_all \
+warn_obsolete_guard \
+warnings_as_errors +bin_opt_info +debug_info -W -o $(BEAMDIR) $<

build: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) build

escript: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) escript

cucumber: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) cucumber

proper: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) proper

eunit: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) eunit

dialyzer: main
$(ERL) -pa $(BEAMDIR) -s sinan main -extra -s $(CURDIR) dialyzer

run: main
$(ERL) -pa $(BEAMDIR)

debug: main
$(ERL) -pa $(BEAMDIR) -s debugger start

smoketests: main
for f in $(wildcard $(SMOKETEST_DIR)/tests/*.py) ; do \
PYTHONPATH=$(PYPATH) python2 $$f ; \
done

testall : cucumber proper eunit smoketests

gh-pages:
./do-gh-pages

clean:
rm -rf _build ;
rm -rf erl_crash.dump
Something went wrong with that request. Please try again.