Makefile 1.12 KB
Newer Older
1 2
include ../config.mak

3 4
VPATH=$(SRC_PATH)/vhook

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
ifeq ($(CONFIG_DARWIN),yes)
8
	SHFLAGS += -flat_namespace -undefined suppress
9
endif
10
HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF)
11 12

ifeq ($(HAVE_IMLIB2),yes)
13
    HOOKS += imlib2$(SLIBSUF)
14 15
endif    

16
ifeq ($(HAVE_FREETYPE2),yes)
17
    HOOKS += drawtext$(SLIBSUF)
18 19 20
    CFLAGS += `freetype-config --cflags`
endif    

21
all: $(HOOKS) 
22

23
SRCS := $(HOOKS:$(SLIBSUF)=.c)
24

Fabrice Bellard's avatar
Fabrice Bellard committed
25
depend: $(SRCS)
26
	$(CC) -MM $(CFLAGS) $^ 1>.depend
27

28
install:
29 30
	install -d "$(libdir)/vhook"
	install -m 755 $(HOOKS) "$(libdir)/vhook"
31

32
imlib2$(SLIBSUF): imlib2.o
33
	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $< -lImlib2
34

35
drawtext$(SLIBSUF): drawtext.o
36
	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $< `freetype-config --libs`
37

38 39
%$(SLIBSUF): %.o
ifeq ($(CONFIG_DARWIN),yes)
40
	$(CC) $(LDFLAGS) $(SHFLAGS) -Wl,-install_name,$(libdir)/vhook/$@ -g -o $@ $<
41
else
42
	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
43
endif
44 45

clean:
46
	rm -f *.o *.d .depend *$(SLIBSUF) *~
47 48 49 50

ifneq ($(wildcard .depend),)
include .depend
endif