]> git.videolan.org Git - x264.git/commitdiff
misc makefile changes.
authorLoren Merritt <pengvado@videolan.org>
Tue, 19 Apr 2005 01:42:12 +0000 (01:42 +0000)
committerLoren Merritt <pengvado@videolan.org>
Tue, 19 Apr 2005 01:42:12 +0000 (01:42 +0000)
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
configure
vfw/build/cygwin/Makefile

index daad7c58b1810d658791e22cd5001d303e37522f..3128c718388717a75cec3457a528700ef4f29663 100644 (file)
--- 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
index 62047c1612367f9a9260f9a884d804d7b398c3f7..422d0d0cbac3300b0271fb10c6a0e00f72bffdc1 100755 (executable)
--- 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
 
index d47e88ea33843ebe171522eeddd3b86ee5c6bbe0..b5a6de167a4abcff6e31ca17632555a64b380aa8 100644 (file)
@@ -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"