2007-03-24 13:12:55 +00:00
|
|
|
KERNEL_INC = /lib/modules/`uname -r`/build/include
|
|
|
|
VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2)
|
2001-12-26 15:49:45 +00:00
|
|
|
MDIR = /lib/modules/$(VERSION)/misc
|
2001-02-24 20:28:24 +00:00
|
|
|
|
2007-03-24 13:12:55 +00:00
|
|
|
CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) \
|
|
|
|
-include $(KERNEL_INC)/linux/modversions.h
|
2007-03-17 13:53:15 +00:00
|
|
|
|
2007-03-17 21:27:42 +00:00
|
|
|
OBJS = mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o
|
2007-03-17 15:41:04 +00:00
|
|
|
|
|
|
|
all: $(OBJS) mga_vid_test tdfx_vid_test
|
2004-06-26 14:03:06 +00:00
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
mga_vid.o: mga_vid.c mga_vid.h
|
2003-03-07 18:42:08 +00:00
|
|
|
tdfx_vid.o: tdfx_vid.c 3dfx.h
|
2007-03-17 21:27:42 +00:00
|
|
|
radeon_vid.o: radeon_vid.c radeon.h radeon_vid.h
|
|
|
|
rage128_vid.o: radeon_vid.c radeon.h radeon_vid.h
|
2007-03-17 15:53:30 +00:00
|
|
|
$(CC) $(CFLAGS) -DRAGE128 -c $< -o $@
|
2007-03-17 21:27:42 +00:00
|
|
|
radeon_vid.o rage128_vid.o:
|
2007-03-17 15:53:30 +00:00
|
|
|
CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math
|
2003-03-07 18:42:08 +00:00
|
|
|
|
2007-03-17 13:56:54 +00:00
|
|
|
install:
|
2006-04-13 16:49:56 +00:00
|
|
|
-mkdir -p $(MDIR)
|
2007-03-17 15:41:04 +00:00
|
|
|
install -m 644 $(OBJS) $(MDIR)
|
2001-12-26 15:49:45 +00:00
|
|
|
depmod -a
|
2007-03-17 15:52:29 +00:00
|
|
|
-mknod /dev/mga_vid c 178 0
|
|
|
|
-mknod /dev/tdfx_vid c 178 0
|
2007-03-17 15:53:30 +00:00
|
|
|
-mknod /dev/radeon_vid c 178 0
|
|
|
|
-ln -s /dev/radeon_vid /dev/rage128_vid
|
2001-12-26 15:49:45 +00:00
|
|
|
|
2006-11-20 11:18:01 +00:00
|
|
|
dep depend:
|
2001-07-28 05:36:45 +00:00
|
|
|
|
2007-03-17 01:12:18 +00:00
|
|
|
clean:
|
2007-03-17 13:53:15 +00:00
|
|
|
rm -f *.o *~ mga_vid_test tdfx_vid_test
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2004-06-26 14:03:06 +00:00
|
|
|
|
2007-03-17 00:45:56 +00:00
|
|
|
.PHONY: all install dep depend clean distclean
|