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.

100 lines
2.2KB

  1. #
  2. # libavutil Makefile
  3. #
  4. include ../config.mak
  5. VPATH=$(SRC_PATH)/libavutil
  6. # NOTE: -I.. is needed to include config.h
  7. CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
  8. OBJS= mathematics.o \
  9. integer.o \
  10. rational.o \
  11. intfloat_readwrite.o \
  12. ifeq ($(TARGET_ARCH_SPARC64),yes)
  13. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  14. endif
  15. SRCS := $(OBJS:.o=.c)
  16. LIB= $(LIBPREF)avutil$(LIBSUF)
  17. ifeq ($(BUILD_SHARED),yes)
  18. LIBVERSION=$(LAVUVERSION)
  19. LIBMAJOR=$(LAVUMAJOR)
  20. NAME=avutil
  21. SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
  22. endif
  23. all: $(LIB) $(SLIBNAME)
  24. $(LIB): $(OBJS)
  25. rm -f $@
  26. $(AR) rc $@ $(OBJS)
  27. $(RANLIB) $@
  28. $(SLIBNAME): $(OBJS)
  29. ifeq ($(CONFIG_WIN32),yes)
  30. $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
  31. -lib /machine:i386 /def:$(@:.dll=.def)
  32. else
  33. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
  34. endif
  35. %.o: %.c
  36. $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
  37. depend: $(SRCS)
  38. $(CC) -MM $(CFLAGS) $^ 1>.depend
  39. dep: depend
  40. clean:
  41. rm -f *.o *.d *~ .depend $(LIB) $(SLIBNAME) *$(SLIBSUF)
  42. distclean: clean
  43. rm -f Makefile.bak .depend
  44. ifeq ($(BUILD_SHARED),yes)
  45. install: all install-headers
  46. ifeq ($(CONFIG_WIN32),yes)
  47. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  48. else
  49. install -d $(libdir)
  50. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
  51. $(libdir)/$(SLIBNAME_WITH_VERSION)
  52. ln -sf $(SLIBNAME_WITH_VERSION) \
  53. $(libdir)/$(SLIBNAME_WITH_MAJOR)
  54. ln -sf $(SLIBNAME_WITH_VERSION) \
  55. $(libdir)/$(SLIBNAME)
  56. $(LDCONFIG) || true
  57. endif
  58. else
  59. install:
  60. endif
  61. installlib: all install-headers
  62. install -m 644 $(LIB) "$(libdir)"
  63. install-headers:
  64. mkdir -p "$(prefix)/include/ffmpeg"
  65. install -m 644 $(SRC_PATH)/libavutil/avutil.h \
  66. $(SRC_PATH)/libavutil/common.h \
  67. $(SRC_PATH)/libavutil/mathematics.h \
  68. $(SRC_PATH)/libavutil/integer.h \
  69. $(SRC_PATH)/libavutil/rational.h \
  70. $(SRC_PATH)/libavutil/intfloat_readwrite.h \
  71. "$(prefix)/include/ffmpeg"
  72. install -d "$(libdir)/pkgconfig"
  73. install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
  74. #
  75. # include dependency files if they exist
  76. #
  77. ifneq ($(wildcard .depend),)
  78. include .depend
  79. endif