[zaptel-commits] tzafrir: branch 1.2 r2748 - /branches/1.2/Makefile

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Mon Jul 16 19:13:57 CDT 2007


Author: tzafrir
Date: Mon Jul 16 19:13:56 2007
New Revision: 2748

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2748
Log:
* Separate programs, modules install-programs and install-modules
  targets.
* Finish DESTDIR / INSTALL_PREFIX separation.

Modified:
    branches/1.2/Makefile

Modified: branches/1.2/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.2/Makefile?view=diff&rev=2748&r1=2747&r2=2748
==============================================================================
--- branches/1.2/Makefile (original)
+++ branches/1.2/Makefile Mon Jul 16 19:13:56 2007
@@ -95,7 +95,7 @@
 
 HOSTCC=gcc
 
-INSTALL_PREFIX	:= $(DESTDIR)
+INSTALL_PREFIX	:= /usr
 
 CFLAGS+=-I. -O4 -g -Wall
 ifneq (,$(findstring ppc,$(PACHINE)))
@@ -122,7 +122,7 @@
 KMAKE:= $(MAKE) -C $(KSRC) SUBDIRS=$(PWD)
 KMAKE_INST:= $(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=misc modules_install
 
-CONFIG_FILE:=$(DESTDIR)/etc/zaptel.conf
+CONFIG_FILE:=/etc/zaptel.conf
 CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
 
 ifeq ($(BUILDVER),linux24)
@@ -201,13 +201,17 @@
 endif
 MAN_PAGES		= $(MAN_PAGES_BASE:%=doc/%.8)
 
+all: programs modules
+
+programs: $(BINS) $(LIBTONEZONE_SO)
+
 ifeq ($(BUILDVER),linux24)
-all: prereq $(MODULESO) wct4xxp/wct4xxp.o $(BINS) $(LIBTONEZONE_SO)
-endif
-
-ifeq ($(BUILDVER),linux26)
-all: prereq $(BINS) $(LIBTONEZONE_SO)
-	@if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi
+modules: prereq $(MODULESO) wct4xxp/wct4xxp.o 
+else
+modules: prereq
+ifeq (,$(wildcard $(KSRC)/.config))
+	@echo "You do not appear to have the sources for the $(KVERS) kernel installed (under $(KSRC))."; exit 1
+endif
 	$(MAKE) -C $(KSRC) SUBDIRS=$(PWD) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE) modules
 endif
 
@@ -403,20 +407,18 @@
 	tar -zxf mISDNuser.tar.gz
 	$(MAKE) -C mISDNuser install
 
-install: all devices firmware
-	install -D -m 755 ztcfg $(DESTDIR)$(SBINDIR)/ztcfg
-ifneq (,$(wildcard sethdlc-new))
-	install -D -m 755 sethdlc-new $(DESTDIR)$(SBINDIR)/sethdlc
-else
-  ifneq (,$(wildcard sethdlc))
-	install -D -m 755 sethdlc $(DESTDIR)$(SBINDIR)/sethdlc
-  endif
-endif
-ifneq (,$(wildcard zttool))
-	install -D -m 755 zttool $(DESTDIR)$(SBINDIR)/zttool
-endif
-	install -d                  $(DESTDIR)$(MANDIR)
-	install -m 644 $(MAN_PAGES) $(DESTDIR)$(MANDIR)
+install: install-modules install-programs
+	@echo "###################################################"
+	@echo "###"
+	@echo "### Zaptel installed successfully."
+	@echo "### If you have not done so before, install init scripts with:"
+	@echo "###"
+	@echo "###   make config"
+	@echo "###"
+	@echo "###################################################"
+
+# Specific to a kernel version:
+install-modules: modules
 ifeq ($(BUILDVER),linux26)
 	for x in $(MODULESKO); do \
 		rm -f $(DESTDIR)/lib/modules/$(KVERS)/extra/$$x ; \
@@ -430,6 +432,23 @@
 	rm -f $(DESTDIR)$(MODS_DIR)/wcfxsusb.o
 endif
 	rm -f $(DESTDIR)$(MODS_DIR)/wcfxs.o
+	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
+
+# All the userspace components. Common to all the system:
+install-programs: programs devices firmware
+	install -D -m 755 ztcfg $(DESTDIR)$(SBINDIR)/ztcfg
+ifneq (,$(wildcard sethdlc-new))
+	install -D -m 755 sethdlc-new $(DESTDIR)$(SBINDIR)/sethdlc
+else
+  ifneq (,$(wildcard sethdlc))
+	install -D -m 755 sethdlc $(DESTDIR)$(SBINDIR)/sethdlc
+  endif
+endif
+ifneq (,$(wildcard zttool))
+	install -D -m 755 zttool $(DESTDIR)$(SBINDIR)/zttool
+endif
+	install -d                  $(DESTDIR)$(MANDIR)
+	install -m 644 $(MAN_PAGES) $(DESTDIR)$(MANDIR)
 	install -D -m 755 $(LIBTONEZONE_SO) $(DESTDIR)$(LIBDIR)/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
 	[ `id -u` = 0 ] && /sbin/ldconfig || :
 	rm -f $(DESTDIR)$(LIBDIR)/$(LIBTONEZONE_SO)
@@ -443,20 +462,15 @@
 	install -d $(DESTDIR)$(INCLUDE_DIR)/linux
 	install -m 644 zaptel.h torisa.h $(DESTDIR)$(INCLUDE_DIR)/linux/
 	install -m 644 tonezone.h $(DESTDIR)$(INCLUDE_DIR)
-	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
-	[ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
-	build_tools/genmodconf $(BUILDVER) "$(INSTALL_PREFIX)" "$(filter-out zaptel ztdummy zttranscode wctc4xxp ztdynamic xpp_usb,$(MODULES)) $(MODULE_ALIASES)"
+ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
+	install -D -m 644 zaptel.conf.sample $(DESTDIR)$(CONFIG_FILE)
+endif
+	build_tools/genmodconf $(BUILDVER) "$(DESTDIR)" "$(filter-out zaptel ztdummy zttranscode wctc4xxp ztdynamic xpp_usb,$(MODULES)) $(MODULE_ALIASES)"
+ifeq (,$(DESTDIR))
 	@if [ -d /etc/modutils ]; then \
 		/sbin/update-modules ; \
 	fi
-	@echo "###################################################"
-	@echo "###"
-	@echo "### Zaptel installed successfully."
-	@echo "### If you have not done so before, install init scripts with:"
-	@echo "###"
-	@echo "###   make config"
-	@echo "###"
-	@echo "###################################################"
+endif
 
 install-udev: devices
 




More information about the zaptel-commits mailing list