[erlang-questions] erlang automake vpath build ebin folder

db masterofquestions@REDACTED
Wed Feb 13 16:50:32 CET 2008


When I do vpath build in automake_test/tmp/build, what I get is that beam
file is placed into tmp/build/src/ folder, not into tmp/build/ebin/.

What I like to see is to have ebin folder in vpath build directory and have
the automake_test.beam file in ebin, like so
tmp/build/ebin/automake_test.beam.

When I also do build(src build) in main root directory "automake_test", what
I get is that beam file placed into the automake_test/src/automake_test.beam
rather than into automake_test/ebin/automake_test.beam.

With the configure.ac, Makefile.am, src/Makefile.am, I was able to install
of erlang app into /usr/local/erlang/otp_r12b-0/lib/erlang/lib, check for
prerequisite erlang libraries (mnesia, etc) and have automake_test.beam file
installed into
/usr/local/erlang/otp_r12b-0/lib/erlang/lib/automake_test/ebin folder.

I would like have ebin folder populated with compiled beam files when
performaing regular build on the same source directory or when on separate
build directory (VPATH builds).  Anyone knows how to do this?

My simple app folder structure:

automake_test
->ebin/
->src/
  ->automake_test.erl
  ->Makefile.am
->tmp/
  ->build/
->Makefile.am
->configure.ac

================
automake_test/configure.ac:

AC_INIT(Some test application, 0.1, address@REDACTED, someapp)
dnl Require autoconf version >=2.59c.
AC_PREREQ(2.59c)
AC_COPYRIGHT(Copyright (C) 2006 tester)
AC_REVISION($Id$)

dnl Require automake version >=1.9.5.
AM_INIT_AUTOMAKE(1.9.5)

AC_ERLANG_NEED_ERLC

AC_ERLANG_SUBST_ROOT_DIR
AC_ERLANG_SUBST_LIB_DIR

dnl Check for standard Erlang/OTP libraries.
AC_ERLANG_CHECK_LIB([edoc])
AC_ERLANG_CHECK_LIB([os_mon])
AC_ERLANG_CHECK_LIB([mnesia])

dnl Determine directories for installation.
AC_ERLANG_SUBST_INSTALL_LIB_DIR
AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(automake_test, 0.1)

dnl Specify the files to instantiate.
AC_CONFIG_FILES([ \
    Makefile \
    src/Makefile \
    ])

AC_OUTPUT

==================
automake_test/Makefile.am:

SUBDIRS = src

==================
automake_test/src/Makefile.am:

erlsrcdir = $(ERLANG_INSTALL_LIB_DIR_automake_test)/src
erlsrc_DATA = automake_test.erl
EXTRA_DIST = $(erlsrc_DATA)

erlbeamdir = $(ERLANG_INSTALL_LIB_DIR_automake_test)/ebin
erlbeam_DATA = automake_test.beam
CLEANFILES = $(erlbeam_DATA)

SUFFIXES = .erl .beam
.erl.beam:
    $(ERLC) $(ERLCFLAGS) -b beam $<

=================

-- 
rk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080213/667a45f0/attachment.htm>


More information about the erlang-questions mailing list