Commit 0c641421 authored by Loren Merritt's avatar Loren Merritt

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
parent 1519835f
......@@ -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
......
......@@ -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
......
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment