File: Makefile

package info (click to toggle)
nozomi 2.1-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 172 kB
  • ctags: 325
  • sloc: ansic: 1,729; makefile: 86; sh: 13
file content (52 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# if HW is PC_24 or PC_26 it compiles for kernel 2.4 resp 2.6
HW=PC_26

#---------- FOR PC 2.6 kernel -----------------------------------
ifeq ($(HW),PC_26)
ifneq ($(KERNELRELEASE),)
obj-m += nozomi.o
else
KDIR:=/lib/modules/$(shell uname -r)/build
INSTALLDIR:=/lib/modules/$(shell uname -r)/kernel/drivers/pci/hotplug
PWD		:= $(shell pwd)

default:
	@echo "Warning: Compiling for 2.6: $(FOR26)"
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
endif
#---------- FOR PC 2.4 kernel -----------------------------------
ifeq ($(HW),PC_24)
#CC 			= gcc-2.95
CC 			= gcc-3.3
KERNELDIR	= -I/usr/src/kernel-headers-2.4.27-2-686/include/
CFLAGS		= -Wall $(KERNELDIR) -O3 -D__KERNEL__ -DMODULE -c -DPC_KERNEL_24
PWD			:= $(shell pwd)

default:
	@echo "Warning: Compiling for 2.4: $(FOR26)"
	$(CC) $(CFLAGS) nozomi.c -c
	$(CC) $(CFLAGS) kfifo.c -c
	ld -r -o noz.o nozomi.o kfifo.o
endif
#----------------------------------------------------------------

c: clean
clean:
	$(RM) *.o *.ko *.mod.* .*.o.cmd .*.mod.* .*.ko.cmd
	$(RM) .tmp_versions -rf
#----------------------------------------------------------------
t: tags
tags: ctags
ctags:
	ctags-exuberant -e *.c

ser: ser.c
	$(CC) ser.c -o ser

i: install
install:
	modprobe -r nozomi
	cp -f nozomi.ko $(INSTALLDIR)
	depmod
#------------------------------------------------