lkml.org 
[lkml]   [2004]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectkernelversion distinction (was 2.6.5 - incomplete headers?)
Date
Am Sonntag, 11. April 2004 13:52 schrieb Jan Dittmer:
> Axel Weiss wrote:
> > Hi,
> >
> > I'm going to bring my device drivers[1] from 2.4 to 2.6 and have
> > successfully installed kernel-2.6.5 for my athlon-PC.
> >
> > (Where is the starting point to read, in this case?)
>
> LWN has quite a collection:
>
> http://lwn.net/Articles/driver-porting/
Thanks, very helpful!

Now, I`m trying to be compatible with older kernels (2.2 - 2.4) and want to
find out what kernel version ist installed, from Makefile. My first solution:

# Makefile
KERNELVERSION := $(shell uname -r)
KERNELBASE := $(basename $(KERNELVERSION))
KERNELMINOR := $(suffix $(KERNELBASE))
KERNELMAJOR := $(basename $(KERNELBASE))

OLD_MODULES := $(strip $(foreach V, .0 .1 .2 .3 .4, $(shell [ "$(V)" =
"$(KERNELMINOR)" ] && echo yes)))

ifeq ($(KERNELMAJOR),2)
ifeq ($(OLD_MODULES),yes)
# old style make
endif #ifeq ($(OLD_MODULES),yes)
# new style make, like pointed out in LWN
else #ifeq ($(KERNELMAJOR),2)
all:
@echo kernel $(KERNELVERSION) not supported
endif #ifeq ($(KERNELMAJOR),2)

Any improvements? Up to which kernel version should old style make be used?

Regards,
Axel Weiss

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.259 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site