Posts Tagged ‘ makefile

我的erlang的makefile模板

目前还不支持文件夹的遍历,只能一个一个写上去。

.SUFFIXES: .erl .beam

.erl.beam:
    erlc ${ERLC_FLAGS} $<

SOURCES = ${wildcard src/api/twitter/*.erl} ${wildcard src/ui/*.erl}
BINS = bin
INCLUDES = include
ERLC_FLAGS = -W -I ${INCLUDES} -o ${BINS}

all: compile

compile:  initDirs ${SOURCES:%.erl=%.beam}

initDirs:
    mkdir -p bin

test: compile
    erl -noshell -pa $(BINS) -s client test -s init stop