ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/Linux/NetDriver/Makefile
Revision: 1.9
Committed: 2004-12-19T15:55:31Z (19 years, 11 months ago) by gbeauche
Branch: MAIN
CVS Tags: nigel-build-19, nigel-build-17
Changes since 1.8: +29 -11 lines
Log Message:
enable build with kernel 2.6

File Contents

# User Rev Content
1 cebix 1.3 # Linux makefile for sheep_net driver
2 gbeauche 1.9 KERNEL_DIR = /lib/modules/$(shell uname -r)
3     KERNEL_SOURCE = $(KERNEL_DIR)/build
4     LV := $(shell test -f $(KERNEL_SOURCE)/Rules.make && echo 24 || echo 26)
5     MP := $(shell test -f $(KERNEL_SOURCE)/Rules.make && echo "o" || echo "ko")
6    
7     ifeq ($(LV),26)
8     # Kernel 2.6
9    
10     obj-m = sheep_net.o
11    
12     sheep_net.ko: sheep_net.c
13     $(MAKE) -C $(KERNEL_SOURCE) M=$$PWD modules
14    
15     clean:
16     $(MAKE) -C $(KERNEL_SOURCE) M=$$PWD clean
17    
18     else
19     # Kernel 2.4
20 cebix 1.1
21     ## System specific configuration
22 gbeauche 1.9 CPPFLAGS = -I. -I$(KERNEL_SOURCE)/include
23 cebix 1.7 CFLAGS = -O2 -Wall -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES
24 cebix 1.1 ASFLAGS =
25     LDFLAGS =
26     LIBS =
27    
28     ## Files
29     OBJS = sheep_net.o
30    
31     ## Rules
32     sheep_net.o: sheep_net.c
33     $(CC) -c $(CPPFLAGS) $(CFLAGS) sheep_net.c
34 cebix 1.2
35 cebix 1.1 clean:
36     -rm $(OBJS)
37    
38     dep depend:
39     makedepend $(CPPFLAGS) -Y *.c
40    
41 gbeauche 1.9 endif
42    
43     dev:
44     mknod /dev/sheep_net c 10 198
45    
46     install: sheep_net.$(MP)
47     install -d $(KERNEL_DIR)/misc
48     install -m 644 sheep_net.$(MP) $(KERNEL_DIR)/misc
49     depmod -a
50    
51 cebix 1.1 # DO NOT DELETE