]> git.sesse.net Git - ffmpeg/blob - libavutil/Makefile
Separate header file installation from the general install target.
[ffmpeg] / libavutil / Makefile
1 #
2 # libavutil Makefile
3 #
4 include ../config.mak
5
6 VPATH=$(SRC_PATH)/libavutil
7
8 # NOTE: -I.. is needed to include config.h
9 CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -DBUILD_AVUTIL -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
10
11 #FIXME: This should be in configure/config.mak
12 ifeq ($(CONFIG_WIN32),yes)
13     LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
14 endif
15
16 OBJS= mathematics.o \
17       integer.o \
18       rational.o \
19       intfloat_readwrite.o \
20
21
22 ifeq ($(TARGET_ARCH_SPARC64),yes)
23 CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
24 endif
25
26 SRCS := $(OBJS:.o=.c)
27
28 NAME=avutil
29 ifeq ($(BUILD_SHARED),yes)
30 LIBVERSION=$(LAVUVERSION)
31 LIBMAJOR=$(LAVUMAJOR)
32 endif
33
34 all: $(LIB) $(SLIBNAME)
35
36 $(LIB): $(OBJS)
37         rm -f $@
38         $(AR) rc $@ $(OBJS)
39         $(RANLIB) $@
40
41 $(SLIBNAME): $(OBJS)
42         $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
43 ifeq ($(CONFIG_WIN32),yes)
44         -lib /machine:i386 /def:$(@:.dll=.def)
45 endif
46
47 %.o: %.c
48         $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
49
50 depend: $(SRCS)
51         $(CC) -MM $(CFLAGS) $^ 1>.depend
52
53 dep:    depend
54
55 clean:
56         rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
57               *.lib *.def *.dll.a *.exp
58
59 distclean: clean
60         rm -f .depend
61
62
63 ifeq ($(BUILD_SHARED),yes)
64 install: all
65 ifeq ($(CONFIG_WIN32),yes)
66         install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
67 else
68         install -d $(libdir)
69         install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
70                 $(libdir)/$(SLIBNAME_WITH_VERSION)
71         ln -sf $(SLIBNAME_WITH_VERSION) \
72                 $(libdir)/$(SLIBNAME_WITH_MAJOR)
73         ln -sf $(SLIBNAME_WITH_VERSION) \
74                 $(libdir)/$(SLIBNAME)
75         $(LDCONFIG) || true
76 endif
77 else
78 install:
79 endif
80
81 installlib: all
82         install -m 644 $(LIB) "$(libdir)"
83
84 install-headers:
85         mkdir -p "$(prefix)/include/ffmpeg"
86         install -m 644 $(SRC_PATH)/libavutil/avutil.h \
87                        $(SRC_PATH)/libavutil/common.h \
88                        $(SRC_PATH)/libavutil/mathematics.h \
89                        $(SRC_PATH)/libavutil/integer.h \
90                        $(SRC_PATH)/libavutil/rational.h \
91                        $(SRC_PATH)/libavutil/intfloat_readwrite.h \
92                 "$(prefix)/include/ffmpeg"
93         install -d "$(libdir)/pkgconfig"
94         install -m 644 ../libavutil.pc "$(libdir)/pkgconfig"
95
96 #
97 # include dependency files if they exist
98 #
99 ifneq ($(wildcard .depend),)
100 include .depend
101 endif