r26914 - in trunk: DOCS/xml/en/video.xml Makefile drivers/Makefile
Author: diego Date: Wed May 28 14:40:15 2008 New Revision: 26914 Log: Merge drivers/Makefile into top-level Makefile. Removed: trunk/drivers/Makefile Modified: trunk/Makefile Changes in other areas also in this revision: Modified: trunk/DOCS/xml/en/video.xml Modified: trunk/Makefile ============================================================================== --- trunk/Makefile (original) +++ trunk/Makefile Wed May 28 14:40:15 2008 @@ -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
On Wed, 28 May 2008 14:40:15 +0200 (CEST) diego <subversion@mplayerhq.hu> wrote:
Log: Merge drivers/Makefile into top-level Makefile.
Is there any sane reason to merge the drivers Makefile into the top level Makefile? If so, could you please elaborate it? If not, i would like to ask you to revert this change as it makes building the drivers a black magic that is not obvious even to the seasoned developer. Attila Kinali PS: Again: Do not touch anything (and i really mean anything) mga_vid related in the MPlayer repo without consulting me first. -- A strange game. The only winning move is not to play. -- Joshua, WarGames
On Wed, Sep 10, 2008 at 05:35:11PM +0200, Attila Kinali wrote:
On Wed, 28 May 2008 14:40:15 +0200 (CEST) diego <subversion@mplayerhq.hu> wrote:
Log: Merge drivers/Makefile into top-level Makefile.
Is there any sane reason to merge the drivers Makefile into the top level Makefile? If so, could you please elaborate it?
There is absolutely no reason to keep it separate. If you look at the diffs you will see that some refactoring was possible due to this change.
If not, i would like to ask you to revert this change as it makes building the drivers a black magic that is not obvious even to the seasoned developer.
Just run any of make drivers make install-drivers make drivers/tdfx_vid.o depending on what you need. How hard can that be? And the build system will keep using a monolithic Makefile as long as I keep maintaining it, that decision is final. Diego
On Wed, Sep 10, 2008 at 06:17:03PM +0200, Diego Biurrun wrote:
On Wed, Sep 10, 2008 at 05:35:11PM +0200, Attila Kinali wrote:
On Wed, 28 May 2008 14:40:15 +0200 (CEST) diego <subversion@mplayerhq.hu> wrote:
Log: Merge drivers/Makefile into top-level Makefile.
Is there any sane reason to merge the drivers Makefile into the top level Makefile? If so, could you please elaborate it?
There is absolutely no reason to keep it separate. If you look at the diffs you will see that some refactoring was possible due to this change.
If not, i would like to ask you to revert this change as it makes building the drivers a black magic that is not obvious even to the seasoned developer.
Just run any of
make drivers make install-drivers make drivers/tdfx_vid.o
depending on what you need. How hard can that be?
And the build system will keep using a monolithic Makefile as long as I keep maintaining it, that decision is final.
I have a mixed opinion on this. I've of course always supported the monolithic makefile, but drivers/ is not part of the MPlayer build. It's separate linux-specific drivers that just happen to be included in the MPlayer repo for convenience and historical reasons. There's no reason one would build these as part of building MPlayer, or vice versa. Also, the reason the whole issue came up was that I could not find a way to build the new mga_vid.o with the Makefile missing from drivers. It took a good deal of investigation with Attila's help before we realized what had happened. If the Makefile is not separated back out, there should be clear build instructions in the drivers directory so that someone needing to build them can quickly figure out how. Rich
On Wed, Sep 10, 2008 at 12:33:00PM -0400, Rich Felker wrote:
On Wed, Sep 10, 2008 at 06:17:03PM +0200, Diego Biurrun wrote:
On Wed, Sep 10, 2008 at 05:35:11PM +0200, Attila Kinali wrote:
On Wed, 28 May 2008 14:40:15 +0200 (CEST) diego <subversion@mplayerhq.hu> wrote:
Log: Merge drivers/Makefile into top-level Makefile.
Is there any sane reason to merge the drivers Makefile into the top level Makefile? If so, could you please elaborate it?
There is absolutely no reason to keep it separate. If you look at the diffs you will see that some refactoring was possible due to this change.
If not, i would like to ask you to revert this change as it makes building the drivers a black magic that is not obvious even to the seasoned developer.
Just run any of
make drivers make install-drivers make drivers/tdfx_vid.o
depending on what you need. How hard can that be?
And the build system will keep using a monolithic Makefile as long as I keep maintaining it, that decision is final.
I have a mixed opinion on this. I've of course always supported the monolithic makefile, but drivers/ is not part of the MPlayer build. It's separate linux-specific drivers that just happen to be included in the MPlayer repo for convenience and historical reasons.
They are not the only Linux-specific things, there is more below vidix/.
There's no reason one would build these as part of building MPlayer, or vice versa.
That's completely orthogonal to the question of having the rules that are used to build them in the same file.
Also, the reason the whole issue came up was that I could not find a way to build the new mga_vid.o with the Makefile missing from drivers. It took a good deal of investigation with Attila's help before we realized what had happened. If the Makefile is not separated back out, there should be clear build instructions in the drivers directory so that someone needing to build them can quickly figure out how.
I'm not opposed to having precise instructions of course. Note that I don't think that looking for a Makefile in a directory is the most obvious or intuitive thing to do. It's just what you were used to... Also note that I *did* update the documentation back then. If you think we should move instructions to a more obvious place, then I'm all ears. Diego
Diego Biurrun wrote:
On Wed, Sep 10, 2008 at 12:33:00PM -0400, Rich Felker wrote:
On Wed, Sep 10, 2008 at 06:17:03PM +0200, Diego Biurrun wrote:
And the build system will keep using a monolithic Makefile as long as I keep maintaining it, that decision is final.
I have a mixed opinion on this. I've of course always supported the monolithic makefile, but drivers/ is not part of the MPlayer build. It's separate linux-specific drivers that just happen to be included in the MPlayer repo for convenience and historical reasons.
They are not the only Linux-specific things, there is more below vidix/.
There's no reason one would build these as part of building MPlayer, or vice versa.
That's completely orthogonal to the question of having the rules that are used to build them in the same file.
I'm not sure that is the case. I'm also not sure that the "Linux-specific" point is really central. I think the relevant question is: would it be possible to just take the drivers/ subdirectory, delete the rest of the MPlayer source tree, and build (and later install and potentially use) the drivers using only the files left in that directory? Are the drivers, in other words, not actually part of MPlayer at all? If so, then that directory is effectively just as standalone as any of the externals, and it should (imperative "should") be possible to so pull out the directory without having to lose the build logic in the process. If not, then there is no particular benefit to having the build logic separate, and it should be treated just like any other subdirectory. -- The Wanderer does, for the record, support the monolithic Makefile in general terms Warning: Simply because I argue an issue does not mean I agree with any side of it. Secrecy is the beginning of tyranny.
participants (5)
-
Attila Kinali -
diego -
Diego Biurrun -
Rich Felker -
The Wanderer