From a7f89980e5b3f4b9a74c70dbc5ffe8aabd28be28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 6 Jul 2014 18:04:32 +0200 Subject: Imported Upstream version 2.9.3 --- test/Makefile-24 | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 test/Makefile-24 (limited to 'test/Makefile-24') diff --git a/test/Makefile-24 b/test/Makefile-24 new file mode 100644 index 0000000..51f01af --- /dev/null +++ b/test/Makefile-24 @@ -0,0 +1,63 @@ +# +# Makefile for building the dopanic module on Linux 2.4 +# + +MOD=dopanic +MOD_CONF= $(MOD:%=%.conf) +RHVER=RH7.1 +KVER=2.6.0 +KTAG= +KSRC=/usr/src/linux +# Note: /usr/src/linux should point to /usr/src/linux-$(KVER)$(KTAG). +# The KVER is only used here for "make install". + +CC=gcc +#Use the cflags that shows all warnings or the one that doesn't. +#CFLAGS = -O2 -Wall -DLINUX_DEBUG +CFLAGS = -O2 + +#Note: Use the following to build a driver with no versioning. +#K_CFLAGS = -D__KERNEL__ -DMODULE -D__SMP__ -DCONFIG_X86_LOCAL_APIC -D__NO_VERSION__ +# +#The K_CFLAGS is used to build on all RedHat systems. +#ADDK_CFLAGS is used only when building on pre RedHat 7.0 systems. +# +K_CFLAGS = -D__KERNEL__ -DMODULE -D__SMP__ -DCONFIG_X86_LOCAL_APIC -DMODULES +ADDK_CFLAGS = -DMODVERSIONS -include /usr/include/linux/modversions.h + +CPPFLAGS = -I. -DLINUX -I/usr/src/linux/include + +K_VERSION:=$(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/') +ifeq ($(K_VERSION), 2.6) + TARGET = dopanic.ko + # CFILES = dopanic.c + # dopanic-objs := $(CFILES:.c=.o) + obj-m += dopanic.o + make -C $(KSRC) V=1 SUBDIRS=$(shell pwd) modules +endif + +#List all the relevant files here +OBJS = dopanic.o + +all: $(MOD) + +$(MOD): $(OBJS) + $(LD) -r -o $(MOD) $(OBJS) + +%.o: %.c + if [ "$(RHVER)" = "PRE-7.0" ]; \ + then \ + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(K_CFLAGS) $(ADDK_CFLAGS) -o $@ $< ; \ + else \ + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(K_CFLAGS) -o $@ $< ; \ + fi + +install: $(MOD) + cp $(MOD) /lib/modules/$(KVER)$(KTAG)/kernel/arch/i386/kernel + +clean: + rm -f $(OBJS) $(MOD) + +clobber: + rm -f $(OBJS) $(MOD) + -- cgit v1.2.3