Simplify vhook build.
[ffmpeg.git] / vhook / Makefile
1 include ../config.mak
2
3 VPATH=$(SRC_PATH)/vhook
4
5 CFLAGS=-fPIC $(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -DHAVE_AV_CONFIG_H
6
7 #FIXME: This needs to be in configure/config.mak
8 ifeq ($(CONFIG_DARWIN),yes)
9         SHFLAGS = -dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(libdir)/vhook/$@
10 endif
11 HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)
12
13 ifeq ($(HAVE_IMLIB2),yes)
14     HOOKS += imlib2$(SLIBSUF)
15     LDFLAGS += -lImlib2
16 endif
17
18 ifeq ($(HAVE_FREETYPE2),yes)
19     HOOKS += drawtext$(SLIBSUF)
20     CFLAGS += `freetype-config --cflags`
21     LDFLAGS += `freetype-config --libs`
22 endif
23
24 all: $(HOOKS)
25
26 SRCS := $(HOOKS:$(SLIBSUF)=.c)
27
28 depend: $(SRCS)
29         $(CC) -MM $(CFLAGS) $^ 1>.depend
30
31 install: $(HOOKS)
32         install -d "$(libdir)/vhook"
33         install -m 755 $(HOOKS) "$(libdir)/vhook"
34
35 %$(SLIBSUF): %.o
36         $(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
37
38 clean:
39         rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
40
41 distclean: clean
42         rm -f .depend
43
44 ifneq ($(wildcard .depend),)
45 include .depend
46 endif