Messages in this thread | | | From | Axel Weiss <> | Subject | kernelversion distinction (was 2.6.5 - incomplete headers?) | Date | Sun, 11 Apr 2004 20:33:19 +0200 |
| |
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/
| |