Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
define generic for product type
  • Loading branch information
fogfish committed Apr 26, 2019
commit d412abfec6446150198fe79a6891763d0ce2f098
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
##
## @doc
## an example Makefile to build and ship erlang software
##
## APP - identity of the application
## ORG - identity of the organization
## URI - identity of the docker repository with last /

APP = datum
ORG = fogfish
URI =

include erlang.mk
include beam.mk

36 changes: 22 additions & 14 deletions erlang.mk → beam.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## @doc
## This makefile is the wrapper of rebar to build and ship erlang software
##
## @version 1.0.9
## @version 1.0.12
.PHONY: all compile test unit clean distclean run console mock-up mock-rm benchmark release dist

APP := $(strip $(APP))
Expand All @@ -27,13 +27,13 @@ REL = ${APP}-${VSN}
PKG = ${REL}+${ARCH}.${PLAT}
TEST ?= tests
COOKIE ?= nocookie
DOCKER ?= fogfish/erlang
DOCKER ?= fogfish/erlang-alpine
IID = ${URI}${ORG}/${APP}

## required tools
## - rebar version (no spaces at end)
## - path to basho benchmark
REBAR ?= 3.5.0
REBAR ?= 3.9.1
BB = ../basho_bench


Expand Down Expand Up @@ -89,17 +89,22 @@ compile: rebar3

##
## execute common test and terminate node
test: _build/test.beam
@mkdir -p /tmp/test/${APP}
@erl ${EFLAGS} -noshell -pa _build/ -pa test/ -run test run test/${TEST}.config
@F=`ls /tmp/test/${APP}/ct_run*/all.coverdata | tail -n 1` ;\
cp $$F /tmp/test/${APP}/ct.coverdata

_build/test.beam: _build/test.erl
@erlc -o _build $<

_build/test.erl:
@mkdir -p _build && echo "${BOOT_CT}" > $@
test:
@./rebar3 ct --config=test/${TEST}.config --cover --verbose
@./rebar3 cover

# test: _build/test.beam
# @mkdir -p /tmp/test/${APP}
# @erl ${EFLAGS} -noshell -pa _build/ -pa test/ -run test run test/${TEST}.config
# @F=`ls /tmp/test/${APP}/ct_run*/all.coverdata | tail -n 1` ;\
# cp $$F /tmp/test/${APP}/ct.coverdata
#
# _build/test.beam: _build/test.erl
# @erlc -o _build $<
#
# _build/test.erl:
# @mkdir -p _build && echo "${BOOT_CT}" > $@
#

testclean:
@rm -f _build/test.beam
Expand Down Expand Up @@ -148,6 +153,7 @@ mock-rm: test/mock/docker-compose.yml
-@docker-compose -f $< down --rmi all -v --remove-orphans

dist-up: docker-compose.yml _build/spawner
@docker-compose build
@docker-compose -f $< up

dist-rm: docker-compose.yml
Expand Down Expand Up @@ -191,6 +197,8 @@ endif

## build docker image
docker: Dockerfile
git status --porcelain
test -z "`git status --porcelain`" || exit -1
docker build \
--build-arg APP=${APP} \
--build-arg VSN=${VSN} \
Expand Down
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
,"src/topological.erl"
,"src/traversable.erl"

,"src/generic.erl"
]}.

%%
Expand Down
Loading