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)
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
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)
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"
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"
if [ "$debug" != "yes" ]; then
CFLAGS="$CFLAGS -s"
LDFLAGS="$LDFLAGS -s"
- VFWFLAGS="-s"
+ VFW_LDFLAGS="$VFW_LDFLAGS -s"
fi
rm -f config.mak
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
-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"