You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.4KB

  1. #
  2. # Main ffmpeg Makefile
  3. # (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. include config.mak
  6. VPATH=$(SRC_PATH)
  7. CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
  8. LDFLAGS+= -g
  9. ifeq ($(TARGET_GPROF),yes)
  10. CFLAGS+=-p
  11. LDFLAGS+=-p
  12. endif
  13. ifeq ($(CONFIG_WIN32),yes)
  14. EXE=.exe
  15. PROG=ffmpeg$(EXE)
  16. else
  17. EXT=
  18. PROG=ffmpeg ffplay
  19. ifeq ($(CONFIG_FFSERVER),yes)
  20. PROG+=ffserver
  21. endif
  22. endif
  23. ifeq ($(CONFIG_AUDIO_BEOS),yes)
  24. EXTRALIBS+=-lmedia -lbe
  25. endif
  26. ifeq ($(BUILD_SHARED),yes)
  27. DEP_LIBS=libavcodec/libavcodec.so libavformat/libavformat.a
  28. else
  29. DEP_LIBS=libavcodec/libavcodec.a libavformat/libavformat.a
  30. ifeq ($(CONFIG_MP3LAME),yes)
  31. EXTRALIBS+=-lmp3lame
  32. endif
  33. ifeq ($(CONFIG_VORBIS),yes)
  34. EXTRALIBS+=-logg -lvorbis -lvorbisenc
  35. endif
  36. endif
  37. ifeq ($(BUILD_VHOOK),yes)
  38. VHOOK=videohook
  39. INSTALLVHOOK=install-vhook
  40. CLEANVHOOK=clean-vhook
  41. endif
  42. OBJS = ffmpeg.o ffserver.o
  43. SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
  44. all: lib $(PROG) $(VHOOK)
  45. lib:
  46. $(MAKE) -C libavcodec all
  47. $(MAKE) -C libavformat all
  48. ffmpeg_g$(EXE): ffmpeg.o $(DEP_LIBS)
  49. $(CC) $(LDFLAGS) -o $@ ffmpeg.o -L./libavcodec -L./libavformat \
  50. -lavformat -lavcodec $(EXTRALIBS)
  51. ffmpeg$(EXE): ffmpeg_g$(EXE)
  52. cp -p $< $@ ; $(STRIP) $@
  53. ffserver$(EXE): ffserver.o $(DEP_LIBS)
  54. $(CC) $(LDFLAGS) $(FFSLDFLAGS) \
  55. -o $@ ffserver.o -L./libavcodec -L./libavformat \
  56. -lavformat -lavcodec $(EXTRALIBS)
  57. ffplay: ffmpeg$(EXE)
  58. ln -sf $< $@
  59. %.o: %.c
  60. $(CC) $(CFLAGS) -c -o $@ $<
  61. videohook:
  62. $(MAKE) -C vhook all
  63. install: all $(INSTALLVHOOK)
  64. $(MAKE) -C libavcodec install
  65. install -d $(prefix)/bin
  66. install -s -m 755 $(PROG) $(prefix)/bin
  67. ln -sf ffmpeg $(prefix)/bin/ffplay
  68. install-vhook: $(prefix)/lib/vhook
  69. $(MAKE) -C vhook install INSTDIR=$(prefix)/lib/vhook
  70. $(prefix)/lib/vhook:
  71. install -d $@
  72. installlib:
  73. $(MAKE) -C libavcodec installlib
  74. $(MAKE) -C libavformat installlib
  75. dep: depend
  76. depend:
  77. $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
  78. clean: $(CLEANVHOOK)
  79. $(MAKE) -C libavcodec clean
  80. $(MAKE) -C libavformat clean
  81. $(MAKE) -C tests clean
  82. rm -f *.o *~ .depend gmon.out TAGS ffmpeg_g$(EXE) $(PROG)
  83. clean-vhook:
  84. $(MAKE) -C vhook clean
  85. distclean: clean
  86. $(MAKE) -C libavcodec distclean
  87. rm -f config.mak config.h
  88. TAGS:
  89. etags *.[ch] libavformat/*.[ch] libavcodec/*.[ch]
  90. # regression tests
  91. libavtest test mpeg4 mpeg: ffmpeg$(EXE)
  92. $(MAKE) -C tests $@
  93. ifneq ($(wildcard .depend),)
  94. include .depend
  95. endif