Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed 'make install' target

  • Loading branch information...
commit 0ea2ead088aa561b9894fbdbae72f23a09256f8d 1 parent ae90817
@saleyn saleyn authored
Showing with 33 additions and 19 deletions.
  1. +9 −1 c_src/Makefile.in
  2. +10 −10 configure.ac
  3. +14 −8 src/Makefile.in
View
10 c_src/Makefile.in
@@ -5,7 +5,9 @@ debug=@DEBUG@
package=@PACKAGE@
version=@PACKAGE_VERSION@
MKDIR_P=@MKDIR_P@
+INSTALL=@INSTALL@
INST_DIR=../priv
+DIST_DIR=@PACKAGE_INSTALL_DIR@/$(notdir $(INST_DIR))
zmq_drv_so_CXXFLAGS=-Wall $(if $(debug),-DZMQDRV_DEBUG) $(CXXFLAGS)
zmq_drv_so_LDFLAGS=-shared -fPIC $(LDFLAGS) -lpthread
@@ -19,7 +21,13 @@ $(INST_DIR)/zmq_drv.so: zmq_drv.cpp
$(CXX) -o $@ $< ${zmq_drv_so_CXXFLAGS} ${zmq_drv_so_LDFLAGS}
clean:
- rm -rf zmq_drv.o ../priv/zmq_drv.so
+ rm -rf zmq_drv.o $(INST_DIR)/zmq_drv.so
distclean: clean
rm Makefile
+
+install:
+ $(MKDIR_P) $(DIST_DIR) $(dir $(DIST_DIR))c_src
+ $(INSTALL) zmq_drv.{h,cpp} $(dir $(DIST_DIR))c_src/
+ $(INSTALL) $(INST_DIR)/zmq_drv.so $(DIST_DIR)/
+ $(INSTALL) $(INST_DIR)/zmq_drv.so $(DIST_DIR)/
View
20 configure.ac
@@ -68,16 +68,13 @@ ERLANG_CHECK_RELEASE
AC_ERLANG_SUBST_ERTS_VER
dnl Determine directories for installation.
-dnl if test "x${prefix}" = "x"; then
+if test "x${prefix}" = "xNONE"; then
dnl Inside Erlang lib directory.
-dnl ERLANG_INSTALL_LIB_DIR="${ERLANG_LIB_DIR}"
-dnl else
+ AC_SUBST([PACKAGE_INSTALL_DIR], [${ERLANG_ERTS_DIR%/*}/lib/${PACKAGE}-${VERSION}])
+else
dnl Under $prefix
-dnl ERLANG_INSTALL_LIB_DIR="${prefix}"
-dnl fi
-
-dnl AC_ERLANG_SUBST_INSTALL_LIB_DIR
-dnl AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR([zmq], ${PACKAGE_VERSION})
+ AC_SUBST([PACKAGE_INSTALL_DIR], [${prefix}/${PACKAGE}-${VERSION}])
+fi
AC_CHECK_HEADER([${ERLANG_DRV_INCLUDE}/erl_driver.h], [], [
AC_MSG_ERROR([Could not find the 'erl_driver.h' header.
@@ -159,7 +156,8 @@ dnl ------------------------------------------------------------------
AC_MSG_NOTICE([Erlang environment])
dnl Check for erl_interface (used by port drivers).
-AC_CONFIG_FILES([Makefile c_src/Makefile src/Makefile src/zmq.app])
+AC_CONFIG_FILES([Makefile c_src/Makefile src/Makefile
+ ebin/zmq.app:src/zmq.app.in])
AC_OUTPUT
dnl --------------------------------------------------
@@ -167,7 +165,9 @@ dnl Configuration report
dnl --------------------------------------------------
echo
-AC_MSG_NOTICE([ == ${PACKAGE} ${PACKAGE_VERSION} ==])
+AC_MSG_NOTICE([ == Package: ${PACKAGE}-${VERSION} ==])
+echo
+AC_MSG_NOTICE([ Install dir: ${PACKAGE_INSTALL_DIR}])
echo
AC_MSG_NOTICE([ C++ compiler: ${CXX}])
AC_MSG_NOTICE([ Erlang compiler: ${ERLC}])
View
22 src/Makefile.in
@@ -1,36 +1,42 @@
ERL=@ERL@
ERLC=@ERLC@
DEBUG=@DEBUG@
+MKDIR_P=@MKDIR_P@
+INSTALL=@INSTALL@
+DIST_DIR=@PACKAGE_INSTALL_DIR@
VSN=@PACKAGE_VERSION@
ERL_FLAGS=@ERL_FLAGS@ -I../include
ERL_SOURCES=$(wildcard *.erl)
EBIN_DIR=../ebin
DOC_DIR=../doc
ERL_OBJECTS=$(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.beam)
-DOC_FILES=$(DOC_DIR)/zmq.html
+DOC_FILES=$(addprefix $(DOC_DIR)/,index.html modules-frame.html \
+ overview-summary.html stylesheet.css zmq.html)
-all: $(ERL_OBJECTS) $(EBIN_DIR) $(EBIN_DIR)/zmq.app
+all: $(ERL_OBJECTS)
$(EBIN_DIR)/%.beam: %.erl
erlc $(ERL_FLAGS) -o ../ebin $<
-$(EBIN_DIR)/zmq.app: zmq.app.in
- @[ -f $(subst .in,,$<) ] || (echo "Rerun configure script!" && exit 1)
- mv -f $(subst .in,,$<) $@
-
clean:
rm -f $(ERL_OBJECTS)
rm -fr $(DOC_DIR)
distclean: clean
- rm -f $(EBIN_DIR)/zmq.app
docs: $(DOC_DIR) $(DOC_FILES)
$(EBIN_DIR) $(DOC_DIR):
- mkdir $@
+ $(MKDIR_P) $@
$(DOC_DIR)/zmq.html: zmq.erl overview.edoc
erl -noshell -run edoc_run application "'zmq'" '"."' \
'[{dir, "$(DOC_DIR)"}, {def, [{version, "$(VSN)"}]}]' -run init stop
+install:
+ @[ -d $(DOC_DIR) ] || (echo "Error: run 'make docs' first!" && exit 1)
+ $(MKDIR_P) $(DIST_DIR)/src $(DIST_DIR)/ebin $(DIST_DIR)/doc
+ $(INSTALL) ../src/*.erl $(DIST_DIR)/src/
+ $(INSTALL) ../ebin/*.{beam,app} $(DIST_DIR)/ebin/
+ $(INSTALL) ../doc/*.{css,html,png} $(DIST_DIR)/doc
+ $(INSTALL) ../{README,LICENSE} $(DIST_DIR)
Please sign in to comment.
Something went wrong with that request. Please try again.