Subversion Repositories f9daq

Rev

Rev 6 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 361
1
TARGET = usmcdrv
1
TARGET = usmcdrv
2
OBJS = usmcdrv-driver.o
2
OBJS = usmcdrv-driver.o
3
MDIR = drivers/misc
3
MDIR = drivers/misc
4
 
4
 
5
EXTRA_CFLAGS = -DEXPORT_SYMTAB
5
EXTRA_CFLAGS = -DEXPORT_SYMTAB
6
CURRENT = $(shell uname -r)
6
CURRENT = $(shell uname -r)
7
KDIR = /lib/modules/$(CURRENT)/build
7
KDIR = /lib/modules/$(CURRENT)/build
8
PWD = $(shell pwd)
8
PWD = $(shell pwd)
9
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
9
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
10
 
10
 
11
obj-m += $(TARGET).o
11
obj-m += $(TARGET).o
12
$(TARGET)-objs := usmcpkt.o usmcdrv-driver.o
12
$(TARGET)-objs := usmcpkt.o usmcdrv-driver.o
13
 
13
 
14
default:
14
default:
15
	make -C $(KDIR) SUBDIRS=$(PWD) modules
15
#	make -C $(KDIR) SUBDIRS=$(PWD) modules
-
 
16
	make -C $(KDIR) M=$(shell pwd) modules
16
 
17
 
17
$(TARGET).o: $(OBJS)
18
$(TARGET).o: $(OBJS)
18
	$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
19
	$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
19
 
20
 
20
ifneq (,$(findstring 2.4.,$(CURRENT)))
21
ifneq (,$(findstring 2.4.,$(CURRENT)))
21
install:
22
install:
22
	su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a"
23
	su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a"
23
else
24
else
24
install:
25
install:
25
	su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
26
	su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
26
endif
27
endif
27
 
28
 
28
clean:
29
clean:
29
	-rm -f *.o *.ko .*.cmd .*.flags *.mod.c
30
	-rm -f *.o *.ko .*.cmd .*.flags *.mod.c
30
 
31
 
31
-include $(KDIR)/Rules.make
32
-include $(KDIR)/Rules.make