nps: nws_mc/Makefile, nws_mc/makefile.common (REMOVED) - makefile....

baggins baggins at pld-linux.org
Thu Sep 22 01:47:36 CEST 2005


Author: baggins                      Date: Wed Sep 21 23:47:36 2005 GMT
Module: nps                           Tag: HEAD
---- Log message:
- makefile.common contents moved to Makefile

---- Files affected:
nps/nws_mc:
   Makefile (1.1 -> 1.2) , makefile.common (1.2 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: nps/nws_mc/Makefile
diff -u nps/nws_mc/Makefile:1.1 nps/nws_mc/Makefile:1.2
--- nps/nws_mc/Makefile:1.1	Sun Sep 18 01:33:03 2005
+++ nps/nws_mc/Makefile	Thu Sep 22 01:47:31 2005
@@ -1,8 +1,64 @@
+################################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# 
+#
+#  $Header$
+# 
+################################################################################
+
+###########################################################################
+# Environment tests
+
 KERNEL_DIR=/usr/src/linux
 PWD=$(shell pwd)
 TOPDIR=$(shell dirname $(PWD))
 
-KERNEL_VERSION := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\([0-9]*\.[0-9]*\)\..*"/\1/')
+# get the kernel version - we use this to find the correct install path
+KVER := $(shell grep -m 1 UTS_RELEASE $(KERNEL_DIR)/include/linux/version.h | sed -e 's/.*UTS_RELEASE "\(.*\)"/\1/')
+
+KERNEL_VERSION := $(shell echo $(KVER) | sed -e 's/\([0-9]*\.[0-9]*\)\..*/\1/')
+
+KKVER := $(shell echo $(KVER) | awk '{ if ($$0 ~ /2\.[4-9]\./) print "1"; else print "0"}')
+ifeq ($(KKVER), 0)
+  $(error *** Aborting the build. \
+          *** This driver is not supported on kernel versions older than 2.4.0)
+endif
+
+ifneq ($(KVER),$(shell uname -r))
+  $(warning ***)
+  $(warning *** Warning: kernel source version ($(KVER)))
+  $(warning *** does not match running kernel  ($(shell uname -r)))
+  $(warning *** Continuing with build,)
+  $(warning *** resulting driver may not be what you want)
+  $(warning ***)
+endif
+
+# pick an appropriate install path
+ifneq (,$(wildcard /lib/modules/$(KVER)/kernel))
+  INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net
+else
+  INSTDIR := /lib/modules/$(KVER)/net
+endif
+
+# depmod version for rpm builds
+DEPVER := $(shell /sbin/depmod -V 2>/dev/null | awk 'BEGIN {FS="."} NR==1 {print $$2}')
+
+###########################################################################
+# Build rules
+.PHONY: clean install uninstall
 
 ifeq ($(KERNEL_VERSION),2.4)
   include $(TOPDIR)/nws_mc/makefile.2_4
@@ -12,4 +68,30 @@
   endif
 endif
 
-include $(TOPDIR)/nws_mc/makefile.common
+install:
+	# remove all old versions of the driver
+	find $(DESTDIR)/lib/modules/$(KVER) -name $(TARGET) -exec rm {} \; \
+		|| true
+	@mkdir -p $(DESTDIR)/lib/modules/$(KVER)
+	install -D -m 644 $(TARGET) $(DESTDIR)$(INSTDIR)/$(TARGET)
+ifeq (,$(DESTDIR))
+	/sbin/depmod -a || true
+else
+  ifeq ($(DEPVER),1 )
+	/sbin/depmod -r $(DESTDIR) -a || true
+  else
+	/sbin/depmod -b $(DESTDIR) -a -n > /dev/null || true
+  endif
+endif
+	@mkdir -p $(DESTDIR)/etc/newisys/nws_mc
+	sed -e "s/<SWInstalledDate>.*</<SWInstalledDate>`date +%s`</" \
+	    -e "s/SWInfo\(.*\)</SWInfo\1 Source</" \
+	  < swinventory.xml > $(DESTDIR)/etc/newisys/nws_mc/swinventory.xml
+	@chmod 644 $(DESTDIR)/etc/newisys/nws_mc/swinventory.xml
+
+uninstall:
+	if [ -e $(INSTDIR)/$(TARGET) ] ; then \
+	    rm -f $(INSTDIR)/$(TARGET) ; \
+	fi
+	/sbin/depmod -a
+	rm -rf /etc/newisys/nws_mc
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/nps/nws_mc/Makefile?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list