changeset 26882:8eacd1538e64

Merge drivers/Makefile into top-level Makefile.
author diego
date Wed, 28 May 2008 12:40:15 +0000
parents 2b55444f1b60
children a365271c97a5
files DOCS/xml/en/video.xml Makefile drivers/Makefile
diffstat 3 files changed, 42 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 <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 @@
 <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>
--- 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
--- 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