ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/Linux/NetDriver/Makefile
(Generate patch)

Comparing BasiliskII/src/Unix/Linux/NetDriver/Makefile (file contents):
Revision 1.5 by cebix, 2002-01-06T14:05:35Z vs.
Revision 1.10 by asvitkine, 2010-04-08T03:58:26Z

# Line 1 | Line 1
1   # Linux makefile for sheep_net driver
2 + 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 + KERNEL_DRIVER   = $(KERNEL_DIR)/kernel/drivers
11 + obj-m = sheep_net.o
12 +
13 + sheep_net.ko: sheep_net.c
14 +        $(MAKE) -C $(KERNEL_SOURCE) M=$$PWD modules
15 +
16 + clean:
17 +        $(MAKE) -C $(KERNEL_SOURCE) M=$$PWD clean
18 +
19 + else
20 + # Kernel 2.4
21  
22   ## System specific configuration
23 < CC = cc
24 < CPPFLAGS = -I. -I/usr/src/linux/include
6 < CFLAGS = -O2 -Wall -D__KERNEL__ -DMODULE
23 > CPPFLAGS = -I. -I$(KERNEL_SOURCE)/include
24 > CFLAGS = -O2 -Wall -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES
25   ASFLAGS =
26   LDFLAGS =
27   LIBS =
28  
29   ## Files
30 + KERNEL_DRIVER   = $(KERNEL_DIR)
31   OBJS = sheep_net.o
32  
33   ## Rules
34   sheep_net.o: sheep_net.c
35          $(CC) -c $(CPPFLAGS) $(CFLAGS) sheep_net.c
36  
18 dev:
19        mknod /dev/sheep_net c 10 198
20
37   clean:
38          -rm $(OBJS)
39  
40   dep depend:
41          makedepend $(CPPFLAGS) -Y *.c
42  
43 + endif
44 +
45 + dev:
46 +        mknod /dev/sheep_net c 10 198
47 +
48 + install: sheep_net.$(MP)
49 +        install -d $(KERNEL_DRIVER)/misc
50 +        install -m 644 sheep_net.$(MP) $(KERNEL_DRIVER)/misc
51 +        depmod -a
52 +
53   # DO NOT DELETE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines