uninstallation support
[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 ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
36 uninstall:
37         rm -f $(addprefix $(libdir)/vhook/,$(ALLHOOKS))
38         -rmdir "$(libdir)/vhook/"
39
40 %$(SLIBSUF): %.o
41         $(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
42
43 clean:
44         rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
45
46 distclean: clean
47         rm -f .depend
48
49 ifneq ($(wildcard .depend),)
50 include .depend
51 endif