From 7173bd96bd7002d3b4ef86f02877b83d80b6c83b Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Sun, 2 May 2010 22:54:22 +0000 Subject: [PATCH] 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 --- configure.ac | 1 + lib/erl/{Makefile => Makefile.am} | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) rename lib/erl/{Makefile => Makefile.am} (57%) diff --git a/configure.ac b/configure.ac index 205cd131..cc71f536 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 similarity index 57% rename from lib/erl/Makefile rename to lib/erl/Makefile.am index 77fe8b6a..ee8fbffd 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 -- 2.17.1