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.

102 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 -DBUILD_AVUTIL -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
  8. #FIXME: This should be in configure/config.mak
  9. ifeq ($(CONFIG_WIN32),yes)
  10. LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
  11. endif
  12. OBJS= mathematics.o \
  13. integer.o \
  14. rational.o \
  15. intfloat_readwrite.o \
  16. ifeq ($(TARGET_ARCH_SPARC64),yes)
  17. CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
  18. endif
  19. SRCS := $(OBJS:.o=.c)
  20. NAME=avutil
  21. ifeq ($(BUILD_SHARED),yes)
  22. LIBVERSION=$(LAVUVERSION)
  23. LIBMAJOR=$(LAVUMAJOR)
  24. endif
  25. all: $(LIB) $(SLIBNAME)
  26. $(LIB): $(OBJS)
  27. rm -f $@
  28. $(AR) rc $@ $(OBJS)
  29. $(RANLIB) $@
  30. $(SLIBNAME): $(OBJS)
  31. $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
  32. ifeq ($(CONFIG_WIN32),yes)
  33. -lib /machine:i386 /def:$(@:.dll=.def)
  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 *~ *.a *.lib *.so *.dylib *.dll \
  42. *.lib *.def *.dll.a *.exp
  43. distclean: clean
  44. rm -f .depend
  45. ifeq ($(BUILD_SHARED),yes)
  46. install: all install-headers
  47. ifeq ($(CONFIG_WIN32),yes)
  48. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
  49. else
  50. install -d $(libdir)
  51. install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
  52. $(libdir)/$(SLIBNAME_WITH_VERSION)
  53. ln -sf $(SLIBNAME_WITH_VERSION) \
  54. $(libdir)/$(SLIBNAME_WITH_MAJOR)
  55. ln -sf $(SLIBNAME_WITH_VERSION) \
  56. $(libdir)/$(SLIBNAME)
  57. $(LDCONFIG) || true
  58. endif
  59. else
  60. install:
  61. endif
  62. installlib: all install-headers
  63. install -m 644 $(LIB) "$(libdir)"
  64. install-headers:
  65. mkdir -p "$(prefix)/include/ffmpeg"
  66. install -m 644 $(SRC_PATH)/libavutil/avutil.h \
  67. $(SRC_PATH)/libavutil/common.h \
  68. $(SRC_PATH)/libavutil/mathematics.h \
  69. $(SRC_PATH)/libavutil/integer.h \
  70. $(SRC_PATH)/libavutil/rational.h \
  71. $(SRC_PATH)/libavutil/intfloat_readwrite.h \
  72. "$(prefix)/include/ffmpeg"
  73. install -d "$(libdir)/pkgconfig"
  74. install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
  75. #
  76. # include dependency files if they exist
  77. #
  78. ifneq ($(wildcard .depend),)
  79. include .depend
  80. endif