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.

96 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. SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
  19. ifeq ($(CONFIG_DARWIN),yes)
  20. SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
  21. endif
  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) $(libdir)/libavutil-$(VERSION)$(SLIBSUF)
  51. ln -sf libavutil-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
  52. $(LDCONFIG) || true
  53. endif
  54. else
  55. install:
  56. endif
  57. installlib: all install-headers
  58. install -m 644 $(LIB) "$(libdir)"
  59. install-headers:
  60. mkdir -p "$(prefix)/include/ffmpeg"
  61. install -m 644 $(SRC_PATH)/libavutil/avutil.h \
  62. $(SRC_PATH)/libavutil/common.h \
  63. $(SRC_PATH)/libavutil/mathematics.h \
  64. $(SRC_PATH)/libavutil/integer.h \
  65. $(SRC_PATH)/libavutil/rational.h \
  66. $(SRC_PATH)/libavutil/intfloat_readwrite.h \
  67. "$(prefix)/include/ffmpeg"
  68. install -d $(libdir)/pkgconfig
  69. install -m 644 ../libavutil.pc $(libdir)/pkgconfig
  70. #
  71. # include dependency files if they exist
  72. #
  73. ifneq ($(wildcard .depend),)
  74. include .depend
  75. endif