From c579bdf7f7cdcd14318e55a196e6bd789c20b199 Mon Sep 17 00:00:00 2001 From: hyc Date: Sat, 29 May 2010 07:26:00 +0000 Subject: [PATCH] Makefile tweaks, use SYS= macro instead of platform targets git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@490 400ebc74-4327-4243-bc38-086b20814532 --- Makefile | 33 ++++++++++++++------------------- README | 22 +++++++++------------- librtmp/Makefile | 7 ++++--- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 379bd3c..b86d4db 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ VERSION=v2.2e CC=$(CROSS_COMPILE)gcc LD=$(CROSS_COMPILE)ld +SYS=posix +#SYS=mingw + CRYPTO=OPENSSL #CRYPTO=POLARSSL #CRYPTO=GNUTLS @@ -18,34 +21,26 @@ OPT=-O2 CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) LDFLAGS=-Wall $(XLDFLAGS) -LIBS=$(CRYPTO_LIB) -lz -THREADLIB=-lpthread +LIBS_posix= +LIBS_mingw=-lws2_32 -lwinmm -lgdi32 +LIBS=$(CRYPTO_LIB) -lz $(LIBS_$(SYS)) + +THREADLIB_posix=-lpthread +THREADLIB_mingw= +THREADLIB=$(THREADLIB_$(SYS)) SLIBS=$(THREADLIB) $(LIBS) LIBRTMP=librtmp/librtmp.a INCRTMP=librtmp/rtmp_sys.h librtmp/rtmp.h librtmp/log.h librtmp/amf.h -EXT= +EXT_posix= +EXT_mingw=.exe +EXT=$(EXT_$(SYS)) -all: - @echo 'use "make posix" for a native Linux/Unix build, or' - @echo ' "make mingw" for a MinGW32 build' - @echo 'use commandline overrides if you want anything else' +all: $(LIBRTMP) progs progs: rtmpdump rtmpgw rtmpsrv rtmpsuck -posix linux unix osx: - @$(MAKE) $(MAKEFLAGS) MF="$(MAKEFLAGS)" progs - -mingw: - @$(MAKE) CROSS_COMPILE=mingw32- LIBS="$(LIBS) -lws2_32 -lwinmm -lgdi32" THREADLIB= EXT=.exe $(MAKEFLAGS) progs - -cygwin: - @$(MAKE) XCFLAGS=-static XLDFLAGS="-static-libgcc -static" EXT=.exe $(MAKEFLAGS) progs - -cross: - @$(MAKE) CROSS_COMPILE=armv7a-angstrom-linux-gnueabi- INC=-I$(STAGING)/usr/include $(MAKEFLAGS) progs - clean: rm -f *.o rtmpdump$(EXT) rtmpgw$(EXT) rtmpsrv$(EXT) rtmpsuck$(EXT) @cd librtmp; $(MAKE) clean diff --git a/README b/README index a0b9f1a..74fd032 100644 --- a/README +++ b/README @@ -1,27 +1,23 @@ -RTMP Dump v2.2d +RTMP Dump v2.2e (C) 2009 Andrej Stepanchuk (C) 2009-2010 Howard Chu (C) 2010 2a665470ced7adb7156fcef47f8199a6371c117b8a79e399a2771e0b36384090 License: GPLv2 http://rtmpdump.mplayerhq.hu/ -To compile type "make" with platform name, e.g. +To compile type "make" with SYS=, e.g. - $ make posix + $ make SYS=posix for Linux, MacOSX, Unix, etc. or - $ make mingw + $ make SYS=mingw for Windows. -You can cross-compile for other platforms using +You can cross-compile for other platforms using the CROSS_COMPILE variable: - $ make cross - -but you may need to override the CROSS_COMPILE and INC variables, e.g. - - $ make arm CROSS_COMPILE=arm-none-linux- INC=-I/my/cross/includes + $ make CROSS_COMPILE=arm-none-linux- INC=-I/my/cross/includes Please read the Makefile to see what other make variables are used. @@ -30,15 +26,15 @@ optionally use GnuTLS or polarssl instead of OpenSSL if desired. You may also build with just rtmpe support, and no rtmps/https support, by specifying -DNO_SSL in the XDEF macro, e.g. - $ make posix XDEF=-DNO_SSL + $ make XDEF=-DNO_SSL or - $ make posix CRYPTO=POLARSSL XDEF=-DNO_SSL + $ make CRYPTO=POLARSSL XDEF=-DNO_SSL You may also turn off all crypto support if desired - $ make posix CRYPTO= + $ make CRYPTO= Note that if using OpenSSL, you must have version 0.9.8 or newer. diff --git a/librtmp/Makefile b/librtmp/Makefile index 47f0a05..b3df636 100644 --- a/librtmp/Makefile +++ b/librtmp/Makefile @@ -22,6 +22,7 @@ OPT=-O2 CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) INCDIR=$(DESTDIR)$(prefix)/include/librtmp +LIBDIR=$(DESTDIR)$(prefix)/lib all: librtmp.a @@ -42,7 +43,7 @@ librtmp.pc: librtmp.pc.in Makefile -e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" librtmp.pc.in > $@ install: librtmp.a librtmp.pc - -mkdir -p $(INCDIR) $(DESTDIR)$(prefix)/lib/pkgconfig + -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig cp amf.h http.h log.h rtmp.h $(INCDIR) - cp librtmp.a $(DESTDIR)$(prefix)/lib - cp librtmp.pc $(DESTDIR)$(prefix)/lib/pkgconfig + cp librtmp.a $(LIBDIR) + cp librtmp.pc $(LIBDIR)/pkgconfig -- 2.50.1