[zaptel-commits] russell: trunk r1256 - /trunk/Makefile

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Thu Aug 3 21:00:30 MST 2006


Author: russell
Date: Thu Aug  3 23:00:29 2006
New Revision: 1256

URL: http://svn.digium.com/view/zaptel?rev=1256&view=rev
Log:
Merge jcollie's team/group/installer branch which improves the install bits
of the Makefile to not install the headers twice, among various other
improvements for things like places where INSTALL_PREFIX wasn't used where it
should be

Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/Makefile?rev=1256&r1=1255&r2=1256&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Aug  3 23:00:29 2006
@@ -7,7 +7,7 @@
 
 .EXPORT_ALL_VARIABLES:
 
-.PHONY: menuselect distclean dist-clean clean version.h all _all install b410p devices programs modules linux24 linux26 xpp tests devel data stackcheck install-udev config update install-programs install-modules install-linux24 install-linux26 firmware
+.PHONY: menuselect distclean dist-clean clean version.h all _all install b410p devices programs modules linux24 linux26 xpp tests devel data stackcheck install-udev config update install-programs install-modules install-linux24 install-linux26 firmware install-include install-libs
 
 HOSTCC=gcc
 CC=gcc
@@ -126,6 +126,7 @@
 LIBTONEZONE_SO:=libtonezone.so
 LIBTONEZONE_SO_MAJOR_VER:=1
 LIBTONEZONE_SO_MINOR_VER:=0
+LIBTONEZONE_A:=libtonezone.a
 
 ifeq ($(findstring xpp_usb,$(MENUSELECT_MODULES)),)
   BUILD_XPP:=yes
@@ -363,7 +364,7 @@
   endif
 endif
 
-install: all devices firmware
+install: all devices firmware install-libs install-include
 	if [ -f ztcfg ]; then \
 		$(INSTALL) -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg; \
 	fi
@@ -394,14 +395,29 @@
 		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \
 	fi; \
 	rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o
-	$(INSTALL) -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
-	[ `id -u` = 0 ] && /sbin/ldconfig || :
-	rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
+	$(INSTALL) -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
+	$(INSTALL) -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
+	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
+	[ -f $(CONFIG_FILE) ] || $(INSTALL) -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
+	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel,$(MODULES))"
+	@if [ -d /etc/modutils ]; then \
+		/sbin/update-modules ; \
+	fi
+
+install-libs: $(LIBTONEZONE_SO) $(LIBTONEZONE_A)
+	$(INSTALL) -D -m 755 $(LIBTONEZONE_A) $(LIB_DIR)/$(LIBTONEZONE_A)
+	$(INSTALL) -D -m 755 $(LIBTONEZONE_SO) $(LIB_DIR)/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
+	if [ -z "$(INSTALL_PREFIX)" -a `id -u` = 0 ]; then \
+		/sbin/ldconfig || : ;\
+	fi
+	rm -f $(LIB_DIR)$(LIBTONEZONE_SO)
 	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER)
+		$(LIB_DIR)/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER)
 	$(LN) -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
-	if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
+		$(LIB_DIR)/$(LIBTONEZONE_SO)
+	if [ -z "$(INSTALL_PREFIX)" && -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(LIB_DIR)/$(LIBTONEZONE_SO); fi
+
+install-include:
 	$(INSTALL) -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/zaptel/zaptel.h
 	$(INSTALL) -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/zaptel/tonezone.h
 	rm -f $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
@@ -409,14 +425,6 @@
 	rm -f $(INSTALL_PREFIX)/usr/include/zaptel.h
 	rm -f $(INSTALL_PREFIX)/usr/include/torisa.h
 	rm -f $(INSTALL_PREFIX)/usr/include/tonezone.h
-	$(INSTALL) -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
-	$(INSTALL) -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
-	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
-	[ -f $(CONFIG_FILE) ] || $(INSTALL) -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
-	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel,$(MODULES))"
-	@if [ -d /etc/modutils ]; then \
-		/sbin/update-modules ; \
-	fi
 
 install-udev: devices
 
@@ -435,18 +443,22 @@
 config:
 	if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
 		$(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \
-		$(CHKCONFIG) --add zaptel; \
+		if [ -z "$(INSTALL_PREFIX)" ]; then \
+			$(CHKCONFIG) --add zaptel; \
+		fi; \
 	elif [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \
 		$(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
-		$(CHKCONFIG) --add zaptel; \
+		if [ -z "$(INSTALL_PREFIX)" ]; then \
+			$(CHKCONFIG) --add zaptel; \
+		fi; \
 	fi 
-	if [ -d /etc/default ] && [ ! -f /etc/default/zaptel ]; then \
+	if [ -d $(INSTALL_PREFIX)/etc/default ] && [ ! -f $(INSTALL_PREFIX)/etc/default/zaptel ]; then \
 			$(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
 	fi
-	if [ -d /etc/sysconfig ] && [ ! -f /etc/sysconfig/zaptel ]; then \
+	if [ -d $(INSTALL_PREFIX)/etc/sysconfig ] && [ ! -f $(INSTALL_PREFIX)/etc/sysconfig/zaptel ]; then \
 		$(INSTALL) -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
 	fi
-	if [ -d /etc/sysconfig/network-scripts ]; then \
+	if [ -d $(INSTALL_PREFIX)/etc/sysconfig/network-scripts ]; then \
 		$(INSTALL) -D -m 755 ifup-hdlc $(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \
 	fi
 
@@ -465,14 +477,9 @@
 	fi
 
 # make should *fail* and not silently succeed if a program did not build
-install-programs: $(BINS) $(LIBTONEZONE) libtonezone.a
+install-programs: $(BINS) install-libs install-include
 	$(INSTALL) -d $(BIN_DIR)
 	$(INSTALL) $(BINS) $(BIN_DIR)
-	$(INSTALL) -d $(LIB_DIR)
-	$(INSTALL) -m 755 $(LIBTONEZONE) libtonezone.a $(LIB_DIR)
-	$(INSTALL) -d $(INC_DIR)/linux
-	$(INSTALL) -m 644 tonezone.h $(INC_DIR)
-	$(INSTALL) -m 644 zaptel.h torisa.h $(INC_DIR)/linux
 
 install-modules: install-$(BUILDVER)
 install-linux24: vpm450m_fw.h.o$(MODULES_BUILD)



More information about the zaptel-commits mailing list