summaryrefslogtreecommitdiffstats
path: root/drivers/Makefile
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-06-26 14:03:06 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-06-26 14:03:06 +0000
commite1ed2ee4de75c153c7240b02ded186462b7f76d0 (patch)
tree52e1de2cf8c99220d8d5816e37a23654f48de4a6 /drivers/Makefile
parentd92f988596af8673e3cdc4ef47963972088b10b2 (diff)
downloadmpv-e1ed2ee4de75c153c7240b02ded186462b7f76d0.tar.bz2
mpv-e1ed2ee4de75c153c7240b02ded186462b7f76d0.tar.xz
mga_vid under linux 2.6.x support written by F. O. Tempel, Ed Sweetman, Gergely Nagy among others
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12695 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'drivers/Makefile')
-rw-r--r--drivers/Makefile32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/Makefile b/drivers/Makefile
index 53a2736b83..b9e6855640 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -1,16 +1,30 @@
-
-KERNEL_INCLUDES = /usr/src/linux/include
-INCLUDES = -I$(KERNEL_INCLUDES)
-CFLAGS = -O2 -D__KERNEL__ -DMODULE -include $(KERNEL_INCLUDES)/linux/modversions.h -Wall
+KERNEL_DIR=/lib/modules/`uname -r`/build
+KERNEL_INCLUDES= $(KERNEL_DIR)/include
+INCLUDES = -I$(KERNEL_INCLUDES) -I$(KERNEL_INCLUDES)/asm
VERSION = $(shell grep UTS_RELEASE $(KERNEL_INCLUDES)/linux/version.h | cut -d '"' -f2)
MDIR = /lib/modules/$(VERSION)/misc
-all: mga_vid.o mga_vid_test
+ifneq (,$(findstring 2.6, $(VERSION)))
+obj-m += mga_vid.o
+CFLAGS = -O2 -D__KERNEL__ -DMODULE -include $(KERNEL_INCLUDES)/config/modversions.h -Wall
+else
+CFLAGS = -O2 -D__KERNEL__ -DMODULE -include $(KERNEL_INCLUDES)/linux/modversions.h -Wall
+endif
+
+all:
+ifneq (,$(findstring 2.6, $(VERSION)))
+ $(MAKE) mga_vid.ko mga_vid_test
+else
+ $(MAKE) mga_vid.o mga_vid_test
+endif
# sis_vid.o
mga_vid.o: mga_vid.c mga_vid.h
$(CC) $(CFLAGS) $(INCLUDES) -c $(basename $@).c
+mga_vid.ko: mga_vid.c mga_vid.h
+ $(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
+
sis_vid.o: sis_vid.c sis_vid.h
$(CC) $(CFLAGS) $(INCLUDES) -c $(basename $@).c
@@ -25,13 +39,21 @@ tdfx_vid_tst: tdfx_vid_tst.c
install: mga_vid.o
if test ! -d $(MDIR) ; then mkdir -p $(MDIR) ; fi
+ifneq (,$(findstring 2.6, $(VERSION)))
+ install -m 644 mga_vid.ko $(MDIR)/mga_vid.ko
+else
install -m 644 mga_vid.o $(MDIR)/mga_vid.o
+endif
depmod -a
dep:
clean:
rm -f *.o *~
+ifneq (,$(findstring 2.6, $(VERSION)))
+ rm -f *.ko .mga* mga_vid.mod.c
+endif
distclean: clean
rm -f mga_vid_test
+