Properly handle vhook build flags for platforms that require special handling.
[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 \
6        -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -DHAVE_AV_CONFIG_H
7
8 HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)
9 ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
10
11 ifeq ($(HAVE_IMLIB2),yes)
12     HOOKS += imlib2$(SLIBSUF)
13     LDFLAGS += -lImlib2
14 endif
15
16 ifeq ($(HAVE_FREETYPE2),yes)
17     HOOKS += drawtext$(SLIBSUF)
18     CFLAGS += `freetype-config --cflags`
19     LDFLAGS += `freetype-config --libs`
20 endif
21
22 SRCS := $(HOOKS:$(SLIBSUF)=.c)
23
24 all: $(HOOKS)
25
26 depend: $(SRCS)
27         $(CC) -MM $(CFLAGS) $^ 1>.depend
28
29 install: $(HOOKS)
30         install -d "$(libdir)/vhook"
31         install -m 755 $(HOOKS) "$(libdir)/vhook"
32
33 uninstall:
34         rm -f $(addprefix $(libdir)/vhook/,$(ALLHOOKS))
35         -rmdir "$(libdir)/vhook/"
36
37 %$(SLIBSUF): %.o
38         $(CC) $(LDFLAGS) -g -o $@ $(VHOOKFLAGS) $<
39
40 clean:
41         rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
42
43 distclean: clean
44         rm -f .depend
45
46 ifneq ($(wildcard .depend),)
47 include .depend
48 endif