# HG changeset patch # User diego # Date 1211978415 0 # Node ID 8eacd1538e6467b41439f378c8fb236d33f21d30 # Parent 2b55444f1b60b0bad270279abcd6f4dd751d998a Merge drivers/Makefile into top-level Makefile. diff -r 2b55444f1b60 -r 8eacd1538e64 DOCS/xml/en/video.xml --- a/DOCS/xml/en/video.xml Wed May 28 11:27:13 2008 +0000 +++ b/DOCS/xml/en/video.xml Wed May 28 12:40:15 2008 +0000 @@ -854,15 +854,14 @@ Installation: - To use it, you first have to compile mga_vid.o: + To use it, you first have to compile drivers/mga_vid.o: -cd drivers -make Then run (as root) - make install + make install-drivers which should install the module and create the device node for you. Load the driver with insmod mga_vid.o @@ -941,14 +940,13 @@ Installing the tdfx_vid.o kernel module: - Compile tdfx_vid.o: + Compile drivers/tdfx_vid.o: -cd drivers -make +make drivers Then run (as root) - make install + make install-drivers which should install the module and create the device node for you. Load the driver with insmod tdfx_vid.o diff -r 2b55444f1b60 -r 8eacd1538e64 Makefile --- a/Makefile Wed May 28 11:27:13 2008 +0000 +++ b/Makefile Wed May 28 12:40:15 2008 +0000 @@ -840,7 +840,7 @@ rm -f $(foreach dir,$(DIRS),$(foreach suffix,/*.o /*.a /*.ho /*~, $(addsuffix $(suffix),$(dir)))) rm -f mplayer$(EXESUF) mencoder$(EXESUF) -distclean: clean testsclean toolsclean +distclean: clean testsclean toolsclean driversclean rm -rf DOCS/tech/doxygen rm -f $(foreach dir,$(DIRS),$(foreach suffix,/*.d, $(addsuffix $(suffix),$(dir)))) rm -f configure.log config.mak config.h codecs.conf.h help_mp.h \ @@ -957,7 +957,41 @@ TOOLS/netstream$(EXESUF): TOOLS/netstream.o $(NETSTREAM_DEPS) $(CC) $(CFLAGS) -o $@ $^ + + +###### drivers ####### + +KERNEL_INC = /lib/modules/`uname -r`/build/include +KERNEL_VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2) +KERNEL_CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) -include $(KERNEL_INC)/linux/modversions.h +KERNEL_OBJS = $(addprefix drivers/, mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o) +MODULES_DIR = /lib/modules/$(KERNEL_VERSION)/misc + +drivers: $(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test + +$(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test: CFLAGS = $(KERNEL_CFLAGS) +drivers/mga_vid.o: drivers/mga_vid.c drivers/mga_vid.h +drivers/tdfx_vid.o: drivers/tdfx_vid.c drivers/3dfx.h +drivers/radeon_vid.o drivers/rage128_vid.o: CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math +drivers/radeon_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h +drivers/rage128_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h + $(CC) $(CFLAGS) -DRAGE128 -c $< -o $@ + +install-drivers: + -mkdir -p $(MODULES_DIR) + install -m 644 $(KERNEL_OBJS) $(MODULES_DIR) + depmod -a + -mknod /dev/mga_vid c 178 0 + -mknod /dev/tdfx_vid c 178 0 + -mknod /dev/radeon_vid c 178 0 + -ln -s /dev/radeon_vid /dev/rage128_vid + +driversclean: + rm -f drivers/*.o drivers/*~ drivers/mga_vid_test drivers/tdfx_vid_test + + + -include $(DEPS) -.PHONY: all doxygen *install* recurse *tools +.PHONY: all doxygen *install* recurse *tools drivers .PHONY: checkheaders *clean dep depend tests diff -r 2b55444f1b60 -r 8eacd1538e64 drivers/Makefile --- a/drivers/Makefile Wed May 28 11:27:13 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -KERNEL_INC = /lib/modules/`uname -r`/build/include -VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2) -MDIR = /lib/modules/$(VERSION)/misc - -CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) \ - -include $(KERNEL_INC)/linux/modversions.h - -OBJS = mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o - -all: $(OBJS) mga_vid_test tdfx_vid_test - -mga_vid.o: mga_vid.c mga_vid.h -tdfx_vid.o: tdfx_vid.c 3dfx.h -radeon_vid.o: radeon_vid.c radeon.h radeon_vid.h -rage128_vid.o: radeon_vid.c radeon.h radeon_vid.h - $(CC) $(CFLAGS) -DRAGE128 -c $< -o $@ -radeon_vid.o rage128_vid.o: CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math - -install: - -mkdir -p $(MDIR) - install -m 644 $(OBJS) $(MDIR) - depmod -a - -mknod /dev/mga_vid c 178 0 - -mknod /dev/tdfx_vid c 178 0 - -mknod /dev/radeon_vid c 178 0 - -ln -s /dev/radeon_vid /dev/rage128_vid - -dep depend: - -clean distclean: - rm -f *.o *~ mga_vid_test tdfx_vid_test - -.PHONY: all install dep depend *clean