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.

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