From 0c641421898f5c3087d52abcfd35ab617d101010 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Tue, 19 Apr 2005 01:42:12 +0000 Subject: [PATCH] misc makefile changes. propogate --extra-cflags to vfw. 'make clean' removes x264.exe and vfw. tweak dependencies. git-svn-id: svn://svn.videolan.org/x264/trunk@210 df754926-b1dd-0310-bc7b-ec298dee348c --- Makefile | 9 +++++---- configure | 22 +++++++++++++++++----- vfw/build/cygwin/Makefile | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index daad7c58..3128c718 100644 --- a/Makefile +++ b/Makefile @@ -26,13 +26,13 @@ endif OBJS = $(SRCS:%.c=%.o) DEP = depend -default: $(DEP) x264 +default: $(DEP) x264$(EXE) -libx264.a: $(DEP) $(OBJS) $(OBJASM) +libx264.a: .depend $(OBJS) $(OBJASM) ar rc libx264.a $(OBJS) $(OBJASM) ranlib libx264.a -x264: libx264.a x264.o +x264$(EXE): libx264.a x264.o $(CC) -o $@ x264.o libx264.a $(LDFLAGS) x264vfw.dll: libx264.a $(wildcard vfw/*.c vfw/*.h) @@ -58,7 +58,8 @@ include .depend endif clean: - rm -f $(OBJS) $(OBJASM) config.h *.a x264.o .depend x264 TAGS + rm -f $(OBJS) $(OBJASM) config.h *.a x264.o x264 x264.exe .depend TAGS + rm -rf vfw/build/cygwin/bin distclean: clean rm -f config.mak vfw/build/cygwin/config.mak diff --git a/configure b/configure index 62047c16..422d0d0c 100755 --- a/configure +++ b/configure @@ -23,12 +23,14 @@ debug="no" vfw="no" CC="gcc" -CFLAGS="-Wall -I. -O4 -funroll-loops -D__X264__" +CFLAGS="-Wall -I. -O4 -funroll-loops -ffast-math -D__X264__" LDFLAGS="" AS="nasm" ASFLAGS="-f elf" +EXE="" + UNAMES="`uname -s`" case "$UNAMES" in BeOS) @@ -54,10 +56,12 @@ case "$UNAMES" in CFLAGS="$CFLAGS -mno-cygwin" LDFLAGS="$LDFLAGS -mno-cygwin" ASFLAGS="-f win32 -DPREFIX" + EXE=".exe" ;; MINGW*) SYS="MINGW" ASFLAGS="-f win32 -DPREFIX" + EXE=".exe" ;; *) echo "Unknown system $UNAMES, edit the configure" @@ -110,9 +114,13 @@ for opt do fi mp4_output="yes" ;; - --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}" + --extra-cflags=*) + CFLAGS="$CFLAGS ${opt#--extra-cflags=}" + VFW_CFLAGS="${opt#--extra-cflags=}" ;; - --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}" + --extra-ldflags=*) + LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}" + VFW_LDFLAGS="${opt#--extra-ldflags=}" ;; --enable-debug) CFLAGS="$CFLAGS -g" @@ -131,7 +139,7 @@ VFWFLAGS= if [ "$debug" != "yes" ]; then CFLAGS="$CFLAGS -s" LDFLAGS="$LDFLAGS -s" - VFWFLAGS="-s" + VFW_LDFLAGS="$VFW_LDFLAGS -s" fi rm -f config.mak @@ -144,11 +152,15 @@ LDFLAGS=$LDFLAGS AS=$AS ASFLAGS=$ASFLAGS VFW=$vfw +EXE=$EXE EOF if [ "$vfw" == "yes" ]; then rm -f vfw/build/cygwin/config.mak - echo "LDFLAGS=$VFWFLAGS" > vfw/build/cygwin/config.mak + cat > vfw/build/cygwin/config.mak << EOF +CFLAGS=$VFW_CFLAGS +LDFLAGS=$VFW_LDFLAGS +EOF echo "default: x264vfw.dll" >> config.mak fi diff --git a/vfw/build/cygwin/Makefile b/vfw/build/cygwin/Makefile index d47e88ea..b5a6de16 100644 --- a/vfw/build/cygwin/Makefile +++ b/vfw/build/cygwin/Makefile @@ -97,7 +97,7 @@ $(DLL): $(DIR_BUILD) $(OBJECTS) -mno-cygwin -shared -Wl,-dll,--out-implib,$@.a,--enable-stdcall-fixup \ -o $@ \ $(OBJECTS) driverproc.def \ - -lgdi32 -lwinmm -lcomdlg32 -lcomctl32 $(LDFLAGS) $(CFLAGS) + -lgdi32 -lwinmm -lcomdlg32 -lcomctl32 $(LDFLAGS) clean: @echo " Cl: Object files and target lib" -- 2.47.3