Oops - forgot to add the test/erl/Makefile to git


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666387 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/erl/Makefile b/test/erl/Makefile
new file mode 100644
index 0000000..8bffb62
--- /dev/null
+++ b/test/erl/Makefile
@@ -0,0 +1,44 @@
+GENDIR=gen
+GEN_INCLUDEDIR=$(GENDIR)/include
+GEN_SRCDIR=$(GENDIR)/src
+GEN_TARGETDIR=$(GENDIR)/ebin
+
+INCLUDEDIR=include
+TARGETDIR=ebin
+SRCDIR=src
+
+ALL_INCLUDEDIR=$(GEN_INCLUDEDIR) $(INCLUDEDIR) ../../lib/erl/include
+INCLUDEFLAGS=$(patsubst %,-I%, ${ALL_INCLUDEDIR})
+
+MODULES = test_server
+
+INCLUDES = 
+TARGETS = $(patsubst %,${TARGETDIR}/%.beam,${MODULES})
+HEADERS = $(patsubst %,${INCLUDEDIR}/%.hrl,${INCLUDES})
+
+all: ${GEN_TARGETDIR}/ ${TARGETS}
+
+RPCFILE = ../ThriftTest.thrift
+THRIFT = ../../compiler/cpp/thrift
+
+${GENDIR}/: ${RPCFILE}
+	rm -rf ${GENDIR}
+	${THRIFT} -alterl ${RPCFILE}
+	mkdir -p ${GEN_INCLUDEDIR}
+	mkdir -p ${GEN_SRCDIR}
+	mkdir -p ${GEN_TARGETDIR}
+	mv -t ${GEN_INCLUDEDIR} gen-erl/*.hrl
+	mv -t ${GEN_SRCDIR} gen-erl/*.erl
+	rm -rf gen-erl
+
+${GEN_TARGETDIR}/: ${GENDIR}/
+	rm -rf ${GEN_TARGETDIR}
+	mkdir -p ${GEN_TARGETDIR}
+	erlc ${INCLUDEFLAGS} -o ${GEN_TARGETDIR} ${GEN_SRCDIR}/*.erl
+
+$(TARGETS): ${TARGETDIR}/%.beam: ${SRCDIR}/%.erl ${GEN_INCLUDEDIR}/ ${HEADERS}
+	erlc ${INCLUDEFLAGS} -o ${TARGETDIR} $<
+
+clean:
+	rm -f ${TARGETDIR}/*.beam
+	rm -rf ${GENDIR}