From 2c42298a29857db4dae2dac2b481de637c755af0 Mon Sep 17 00:00:00 2001 From: Gerhard Jaeger Date: Fri, 16 Jul 2004 11:32:04 +0000 Subject: [PATCH] Getting version information now out of the backends main file. --- doc/plustek/MakeModule.sh | 16 +++++++++++++--- doc/plustek/Makefile.kernel24 | 8 +++----- doc/plustek/Makefile.kernel26 | 10 ++-------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/plustek/MakeModule.sh b/doc/plustek/MakeModule.sh index 1b2a8d107..2f30b5b27 100755 --- a/doc/plustek/MakeModule.sh +++ b/doc/plustek/MakeModule.sh @@ -34,7 +34,7 @@ fi echo -e "\b\b\b - done." # -# +# Version checks... # echo -e "\nCheck for kernelversion:" if [ "$OSMINOR" == "6" ]; then @@ -48,6 +48,9 @@ else exit -2 fi +# +# Setup... +# echo -e "Build-directory: \n"$BUILD_DIR echo -n "Removing build-directory..." rm -rf $BUILD_DIR @@ -62,7 +65,7 @@ echo -n "Linking source files..." C_FILES=`ls $SRC_DIR/plustek-pp_*.c` H_FILES=`ls $SRC_DIR/plustek-pp_*.h` -for F in $C_FILES $H_FILES $SRC_DIR/plustek-pp.h; do +for F in $C_FILES $H_FILES $SRC_DIR/plustek-pp.h $SRC_DIR/plustek_pp.c; do ln -s $F . done echo -e "\b\b\b - done." @@ -71,14 +74,21 @@ echo -n "Copying Makefile to build-directory..." cp $MAKEFILE Makefile echo -e "\b\b\b - done." +# +# Building the module... +# echo "Making the module..." if [ "$OSMINOR" == "4" ]; then make all $1 else make -C /lib/modules/$KERNEL_V/build/ SUBDIRS=$BUILD_DIR modules $1 fi - +RES=$? cd .. +if [ $RES != 0 ]; then + echo "There were some build errors..." + exit -1 +fi echo "done." echo "Should I install the module?" diff --git a/doc/plustek/Makefile.kernel24 b/doc/plustek/Makefile.kernel24 index 41d8a9af9..207ef39dd 100644 --- a/doc/plustek/Makefile.kernel24 +++ b/doc/plustek/Makefile.kernel24 @@ -28,8 +28,7 @@ REF = cxref # # common compiler options # -OPT = -fomit-frame-pointer -D_PTDRV_V1=$(VERSION1) \ --D_PTDRV_V0=$(VERSION0) -D_PTDRV_BUILD=$(BUILD) +OPT = -fomit-frame-pointer -D_PTDRV_VERSTR=\"$(VERSIONSTR)\" # # cxref options @@ -52,9 +51,8 @@ REFOPT = -xref-all -index-all -html32 ifeq ($(LINUXVERSION),) LINUXVERSION = $(shell uname -r) endif -VERSION0 = $(shell cat ./../VERSION0) -VERSION1 = $(shell cat ./../VERSION1) -BUILD = $(shell cat ./../BUILD) + +VERSIONSTR = $(shell grep "define BACKEND_VERSION" $(SRC_DIR)/plustek_pp.c | cut -b25-50 ) # Change it here or specify it on the "make" commandline ifeq ($(HEADER_PATH),) diff --git a/doc/plustek/Makefile.kernel26 b/doc/plustek/Makefile.kernel26 index 0a8f57f9b..fd3d3d547 100644 --- a/doc/plustek/Makefile.kernel26 +++ b/doc/plustek/Makefile.kernel26 @@ -10,23 +10,17 @@ ifeq ($(LINUXVERSION),) endif LINUXRELEASE = $(shell uname -r | cut -d'.' -f3) -VERSION0 = $(shell cat $(SUBDIRS)/../VERSION0) -VERSION1 = $(shell cat $(SUBDIRS)/../VERSION1) -BUILD = $(shell cat $(SUBDIRS)/../BUILD) +VERSIONSTR = $(shell grep "define BACKEND_VERSION" $(PWD)/plustek_pp.c | cut -b25-50 ) # # extra flags # -EXTRA_CFLAGS += -D_PTDRV_V1=$(VERSION1) -D_PTDRV_V0=$(VERSION0) -D_PTDRV_BUILD=$(BUILD) +EXTRA_CFLAGS += -D_PTDRV_VERSTR=\"$(VERSIONSTR)\" ifeq ($(DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -ifeq ($(shell test `uname -r | cut -d'.' -f3` -lt 6 && echo 1),1) - EXTRA_CFLAGS += -mhard-float -endif - # # the module name #