Merge drivers/Makefile into top-level Makefile.
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 28 May 2008 12:40:15 +0000 (12:40 +0000)
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 28 May 2008 12:40:15 +0000 (12:40 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@26914 b3059339-0415-0410-9bf9-f77b7e298cf2

DOCS/xml/en/video.xml
Makefile
drivers/Makefile [deleted file]

index 2c1d3b8..a60a894 100644 (file)
@@ -854,15 +854,14 @@ For a Linux 2.6.x version of this driver check out
 <procedure>
 <title>Installation:</title>
 <step><para>
-  To use it, you first have to compile <filename>mga_vid.o</filename>:
+  To use it, you first have to compile <filename>drivers/mga_vid.o</filename>:
   <screen>
-cd drivers
-make<!--
+make drivers<!--
 --></screen>
 </para></step>
 <step><para>
   Then run (as <systemitem class="username">root</systemitem>)
-  <screen>make install</screen>
+  <screen>make install-drivers</screen>
   which should install the module and create the device node for you.
   Load the driver with
   <screen>insmod mga_vid.o</screen>
@@ -941,14 +940,13 @@ the following instructions.
 <procedure>
 <title>Installing the tdfx_vid.o kernel module:</title>
 <step><para>
-  Compile <filename>tdfx_vid.o</filename>:
+  Compile <filename>drivers/tdfx_vid.o</filename>:
   <screen>
-cd drivers
-make</screen>
+make drivers</screen>
 </para></step>
 <step><para>
   Then run (as <systemitem class="username">root</systemitem>)
-  <screen>make install</screen>
+  <screen>make install-drivers</screen>
   which should install the module and create the device node for you.
   Load the driver with
   <screen>insmod tdfx_vid.o</screen>
index c853648..e584834 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -840,7 +840,7 @@ clean:
        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 @@ NETSTREAM_DEPS = libavutil/libavutil.a \
 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 --git a/drivers/Makefile b/drivers/Makefile
deleted file mode 100644 (file)
index b2f96e9..0000000
+++ /dev/null
@@ -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