for new module-tag.py
[nozomi.git] / Makefile
1 # if HW is PC_24 or PC_26 it compiles for kernel 2.4 resp 2.6
2 HW=PC_26
3
4 #---------- FOR PC 2.6 kernel -----------------------------------
5 ifeq ($(HW),PC_26)
6 ifneq ($(KERNELRELEASE),)
7 obj-m += nozomi.o
8 else
9 KDIR:=/lib/modules/$(shell uname -r)/build
10 INSTALLDIR:=/lib/modules/$(shell uname -r)/kernel/drivers/pci/hotplug
11 PWD             := $(shell pwd)
12
13 default:
14         @echo "Warning: Compiling for 2.6: $(FOR26)"
15         $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
16 endif
17 endif
18 #---------- FOR PC 2.4 kernel -----------------------------------
19 ifeq ($(HW),PC_24)
20 #CC                     = gcc-2.95
21 CC                      = gcc-3.3
22 KERNELDIR       = -I/usr/src/kernel-headers-2.4.27-2-686/include/
23 CFLAGS          = -Wall $(KERNELDIR) -O3 -D__KERNEL__ -DMODULE -c -DPC_KERNEL_24
24 PWD                     := $(shell pwd)
25
26 default:
27         @echo "Warning: Compiling for 2.4: $(FOR26)"
28         $(CC) $(CFLAGS) nozomi.c -c
29         $(CC) $(CFLAGS) kfifo.c -c
30         ld -r -o noz.o nozomi.o kfifo.o
31 endif
32 #----------------------------------------------------------------
33
34 c: clean
35 clean:
36         $(RM) *.o *.ko *.mod.* .*.o.cmd .*.mod.* .*.ko.cmd
37         $(RM) .tmp_versions -rf
38 #----------------------------------------------------------------
39 t: tags
40 tags: ctags
41 ctags:
42         ctags-exuberant -e *.c
43
44 ser: ser.c
45         $(CC) ser.c -o ser
46
47 i: install
48 install:
49         -modprobe -r nozomi
50         cp -f nozomi.ko $(INSTALLDIR)
51         depmod
52 #------------------------------------------------