changeset 23182:8749e6b047ef

Reuse common Makefile infrastructure.
author diego
date Tue, 01 May 2007 19:16:35 +0000
parents 802db540ff83
children 82cfeb375358
files Makefile
diffstat 1 files changed, 9 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue May 01 19:15:29 2007 +0000
+++ b/Makefile	Tue May 01 19:16:35 2007 +0000
@@ -6,11 +6,6 @@
 
 include config.mak
 
-CFLAGS = -I. -I./libavutil $(OPTFLAGS)
-
-CFLAGS-$(LIBAVCODEC)        += -I./libavcodec
-CFLAGS                      += $(CFLAGS-yes)
-
 COMMON_LDFLAGS += $(EXTRA_LIB)\
                   $(EXTRALIBS) \
 
@@ -91,11 +86,6 @@
 ALL_PRG-$(MPLAYER)  += mplayer$(EXESUF)
 ALL_PRG-$(MENCODER) += mencoder$(EXESUF)
 
-OBJS_COMMON   = $(SRCS_COMMON:.c=.o)
-OBJS_MPLAYER  = $(SRCS_MPLAYER:.c=.o)
-OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
-
-SRCS_COMMON  += $(SRCS_COMMON-yes)
 COMMON_LIBS  += $(COMMON_LIBS-yes)
 LIBS_MPLAYER += $(LIBS_MPLAYER-yes)
 OBJS_MPLAYER += $(OBJS_MPLAYER-yes)
@@ -141,10 +131,13 @@
 
 all:	$(ALL_PRG)
 
-dep depend: help_mp.h version.h codecs.conf.h
-	$(CC) -MM $(CFLAGS) $(SRCS_MPLAYER) $(SRCS_MENCODER) $(SRCS_COMMON) 1>.depend
+dep depend:: help_mp.h version.h codecs.conf.h
 	@for a in $(PARTS); do $(MAKE) -C $$a dep; done
 
+include mpcommon.mak
+
+CFLAGS := $(subst -I..,-I.,$(CFLAGS))
+
 libaf/libaf.a:
 	$(MAKE) -C libaf
 
@@ -305,16 +298,15 @@
 	  fi ; \
 	done
 
-clean:
-	-rm -f *.o *.a *~
+clean::
 	-rm -f mplayer$(EXESUF) mencoder$(EXESUF) codec-cfg$(EXESUF) \
 	  codecs2html$(EXESUF) codec-cfg-test$(EXESUF) cpuinfo$(EXESUF) \
 	  codecs.conf.h help_mp.h version.h
 	@for a in $(PARTS); do $(MAKE) -C $$a clean; done
 
-distclean: clean doxygen_clean
+distclean:: doxygen_clean
 	@for a in $(PARTS); do $(MAKE) -C $$a distclean; done
-	-rm -f .depend configure.log config.mak config.h
+	-rm -f configure.log config.mak config.h
 
 strip:
 	strip -s $(ALL_PRG)
@@ -405,7 +397,4 @@
 
 libass/libass.a: .norecurse $(wildcard libass/*.[ch])
 
--include .depend
-
-.PHONY: all install* uninstall clean distclean strip dep depend
-.PHONY: doxygen doxygen_clean
+.PHONY: all install* uninstall strip doxygen doxygen_clean