Commit | Line | Data |
---|---|---|
c11c2bc2 AS |
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 | |
320d060a | 9 | CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -DBUILD_AVUTIL -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE |
c11c2bc2 | 10 | |
c0af3840 DB |
11 | #FIXME: This should be in configure/config.mak |
12 | ifeq ($(CONFIG_WIN32),yes) | |
320d060a | 13 | LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a) |
c0af3840 DB |
14 | endif |
15 | ||
c11c2bc2 AS |
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 | ||
4bdd05e7 | 28 | NAME=avutil |
c11c2bc2 | 29 | ifeq ($(BUILD_SHARED),yes) |
f3b60109 DB |
30 | LIBVERSION=$(LAVUVERSION) |
31 | LIBMAJOR=$(LAVUMAJOR) | |
c11c2bc2 AS |
32 | endif |
33 | ||
4e159595 | 34 | all: $(LIB) $(SLIBNAME) |
c11c2bc2 AS |
35 | |
36 | $(LIB): $(OBJS) | |
37 | rm -f $@ | |
38 | $(AR) rc $@ $(OBJS) | |
39 | $(RANLIB) $@ | |
40 | ||
4e159595 | 41 | $(SLIBNAME): $(OBJS) |
c0af3840 | 42 | $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) |
c11c2bc2 | 43 | ifeq ($(CONFIG_WIN32),yes) |
c11c2bc2 | 44 | -lib /machine:i386 /def:$(@:.dll=.def) |
c11c2bc2 AS |
45 | endif |
46 | ||
47 | %.o: %.c | |
115329f1 | 48 | $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< |
c11c2bc2 AS |
49 | |
50 | depend: $(SRCS) | |
51 | $(CC) -MM $(CFLAGS) $^ 1>.depend | |
52 | ||
53 | dep: depend | |
54 | ||
55 | clean: | |
320d060a DB |
56 | rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \ |
57 | *.lib *.def *.dll.a *.exp | |
c11c2bc2 AS |
58 | |
59 | distclean: clean | |
04c07634 | 60 | rm -f .depend |
c11c2bc2 AS |
61 | |
62 | ||
b12f8273 | 63 | install-lib-shared: $(SLIBNAME) |
c11c2bc2 | 64 | ifeq ($(CONFIG_WIN32),yes) |
4e159595 | 65 | install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)" |
c11c2bc2 | 66 | else |
f3b60109 DB |
67 | install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \ |
68 | $(libdir)/$(SLIBNAME_WITH_VERSION) | |
69 | ln -sf $(SLIBNAME_WITH_VERSION) \ | |
70 | $(libdir)/$(SLIBNAME_WITH_MAJOR) | |
71 | ln -sf $(SLIBNAME_WITH_VERSION) \ | |
72 | $(libdir)/$(SLIBNAME) | |
c11c2bc2 AS |
73 | endif |
74 | ||
b12f8273 | 75 | install-lib-static: $(LIB) |
c11c2bc2 AS |
76 | install -m 644 $(LIB) "$(libdir)" |
77 | ||
78 | install-headers: | |
dc2a1ce5 DB |
79 | install -m 644 avutil.h common.h mathematics.h integer.h \ |
80 | rational.h intfloat_readwrite.h "$(incdir)" | |
81 | install -m 644 $(SRC_PATH)/libavutil.pc "$(libdir)/pkgconfig" | |
c11c2bc2 AS |
82 | |
83 | # | |
84 | # include dependency files if they exist | |
85 | # | |
86 | ifneq ($(wildcard .depend),) | |
87 | include .depend | |
88 | endif |