summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Duxbury <bryanduxbury@apache.org>2010-05-02 22:54:22 +0000
committerBryan Duxbury <bryanduxbury@apache.org>2010-05-02 22:54:22 +0000
commit7173bd96bd7002d3b4ef86f02877b83d80b6c83b (patch)
treee1546ec73bc61afb0ed1fe3809116727ea3f68ae
parent6a681873383b931c82f5a4ddafb0c58547516eca (diff)
downloadthrift-7173bd96bd7002d3b4ef86f02877b83d80b6c83b.tar.gz
THRIFT-646. erl: Erlang library is missing install target
This patch adds a new install target to the erlang makefile. It also converts the Makefile to Makefile.am Patch: Anthony Molinaro git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940326 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--configure.ac1
-rw-r--r--lib/erl/Makefile.am (renamed from lib/erl/Makefile)22
2 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 205cd1317..cc71f536e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,6 +259,7 @@ AC_CONFIG_FILES([
lib/cpp/thrift-nb.pc
lib/cpp/thrift-z.pc
lib/csharp/Makefile
+ lib/erl/Makefile
lib/java/Makefile
lib/perl/Makefile
lib/perl/test/Makefile
diff --git a/lib/erl/Makefile b/lib/erl/Makefile.am
index 77fe8b6a6..ee8fbffd1 100644
--- a/lib/erl/Makefile
+++ b/lib/erl/Makefile.am
@@ -17,6 +17,9 @@
# under the License.
#
+# directory where erlang library code should live
+ERL_LIB_ROOT_DIR=$(shell erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell)
+
MODULES = \
src
@@ -25,8 +28,20 @@ all clean docs:
(cd $$dir; ${MAKE} $@); \
done
+ERLLIBDIR=$(DESTDIR)$(ERL_LIB_ROOT_DIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+
install: all
- echo 'No install target, sorry.'
+ mkdir -p $(ERLLIBDIR) ; \
+ mkdir -p $(ERLLIBDIR)/ebin ; \
+ mkdir -p $(ERLLIBDIR)/include ; \
+ mkdir -p $(ERLLIBDIR)/src ; \
+ for i in ebin/*.app* ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
+ for i in ebin/*.beam ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
+ for i in include/*.hrl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done ; \
+ for i in src/*.erl ; do $(INSTALL) $$i $(ERLLIBDIR)/$$i ; done
+
+uninstall:
+ rm -rf $(ERLLIBDIR)
check: all
@@ -35,3 +50,8 @@ distclean: clean
# Hack to make "make dist" work.
# This should not work, but it appears to.
distdir:
+
+MAINTAINERCLEANFILES = Makefile.in
+
+maintainer-clean:
+ test ! -d ebin || rm -rf ebin