]> granicus.if.org Git - rtmpdump/commitdiff
Makefile tweaks, use SYS= macro instead of platform targets
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 29 May 2010 07:26:00 +0000 (07:26 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 29 May 2010 07:26:00 +0000 (07:26 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@490 400ebc74-4327-4243-bc38-086b20814532

Makefile
README
librtmp/Makefile

index 379bd3c7261ecb08005bc027d7f3c1f263ef7dbe..b86d4db377a9492126db56be25382fe51a6189dd 100644 (file)
--- 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 a0b9f1aede988ad9436bd74d389a8aa933e683f9..74fd032de17cef6fa4dab686eedc83586b7c0d22 100644 (file)
--- 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=<platform name>, 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.
 
index 47f0a0544de4fa5d8bff975f2fca4e0e8f3a527b..b3df6369cbfc0c86b00e634f87d8feac278bbfb5 100644 (file)
@@ -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