[asterisk-commits] rizzo: trunk r92002 - /trunk/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 9 10:47:25 CST 2007


Author: rizzo
Date: Sun Dec  9 10:47:25 2007
New Revision: 92002

URL: http://svn.digium.com/view/asterisk?view=rev&rev=92002
Log:
Implement the outcome of a discussion on the -dev list re. the use
of DESTDIR and INSTALL_PATH - many thanks to Tzafrir Cohen and
Simon Perreault for extremely useful feedback:
 
1. comment out the [directories] section the created asterisk.conf ;
   you can set the correct defaults at build time using INSTALL_PATH,
   so the repetition here is redundant and often wrong.
   (The next step now is move asterisk.conf outside the Makefile to
   asterisk.conf.sample, because there is little if anything here
   that needs to be constructed at build/install time).
 
2. use DESTDIR?=$(INSTALL_PATH) so you only need to specify a path
   once if the two coincide. This should have no ill side effects, 
   because if you don't specify DESTDIR, you really need
   INSTALL_PATH="" to set the correct defaults, and if you specify
   DESTDIR the value is not overridden.

The second part required moving the 'export DESTDIR' right after
the assignment to prevent DESTDIR getting set by the export 
(this is documented in the Makefile).o hopefully avoid the mistake)$

With this change you can now do something like this from your source tree:

	make INSTALL_PATH=/some/place install samples

and then

	main/asterisk -vdc

which will pick up the correct config files and libraries from
/some/place - i.e. great for developers!


Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?view=diff&rev=92002&r1=92001&r2=92002
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sun Dec  9 10:47:25 2007
@@ -53,7 +53,6 @@
 export HOST_CC
 export STATIC_BUILD
 export INSTALL
-export DESTDIR
 export PROC
 export SOLINK
 export STRIP
@@ -88,12 +87,13 @@
 # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
 DEBUG=-g3
 
-# Staging directory
+# DESTDIR is the staging directory.
 # Files are copied here temporarily during the install process
-# For example, make DESTDIR=/tmp/asterisk woud put things in
-# /tmp/asterisk/etc/asterisk
-# !!! Watch out, put no spaces or comments after the value !!!
-#DESTDIR?=/tmp/asterisk
+# WARNING: do not put spaces or comments after the value.
+# Also, do not export it before this point or the 'export' will
+# assign it to the empty string so ?= fails.
+DESTDIR?=$(INSTALL_PATH)
+export DESTDIR
 
 # Define standard directories for various platforms
 # These apply if they are not redefined in asterisk.conf 
@@ -578,7 +578,7 @@
 	@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
 		echo "Creating asterisk.conf"; \
 		( \
-		echo "[directories]" ; \
+		echo "[directories](!) ; remove the (!) to enable this" ; \
 		echo "astetcdir => $(ASTETCDIR)" ; \
 		echo "astmoddir => $(MODULES_DIR)" ; \
 		echo "astvarlibdir => $(ASTVARLIBDIR)" ; \




More information about the asterisk-commits mailing list