libdrawtext

view Makefile.in @ 26:b567a6360491

updated the revision number in the library filename
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 15 Apr 2014 05:45:11 +0300
parents df6d52b36bd6
children
line source
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
5 abi = 0
6 rev = 2
8 lib_a = $(name).a
10 ifeq ($(shell uname -s), Darwin)
11 lib_so = $(name).dylib
12 sharedopt = -dynamiclib
14 libgl = -framework OpenGL -lGLEW
15 else
16 soname = $(name).so.$(abi)
17 lib_so = $(soname).$(rev)
18 linkname = $(name).so
19 sharedopt = -shared -Wl,-soname,$(soname)
21 libgl = -lGL -lGLU -lGLEW
22 endif
24 CC = gcc
25 CFLAGS = -pedantic -Wall -g -fPIC -I$(PREFIX)/include $(ft2_cflags)
26 LDFLAGS = -L$(PREFIX)/lib $(ft2_libs) $(libgl)
28 .PHONY: all
29 all: $(lib_a) $(lib_so)
31 $(lib_a): $(obj)
32 $(AR) rcs $@ $(obj)
34 $(lib_so): $(obj)
35 $(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS)
37 -include $(dep)
39 %.d: %.c
40 @$(CPP) $(CFLAGS) -MM $< >$@
42 .PHONY: cleanobj
43 cleanobj:
44 rm -f $(obj)
46 .PHONY: clean
47 clean:
48 rm -f $(obj) $(lib_a) $(lib_so)
50 .PHONY: cleandep
51 cleandep:
52 rm -f $(dep)
54 .PHONY: install
55 install: $(lib_a) $(lib_so)
56 mkdir -p $(PREFIX)/lib $(PREFIX)/include
57 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
58 cp $(lib_so) $(PREFIX)/lib/$(lib_so)
59 cp src/drawtext.h $(PREFIX)/include/drawtext.h
60 [ -n "$(linkname)" ] && \
61 rm -f $(PREFIX)/lib/$(linkname) $(PREFIX)/lib/$(soname) && \
62 cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) && ln -s $(lib_so) $(soname) || true
65 .PHONY: uninstall
66 uninstall:
67 rm -f $(PREFIX)/lib/$(lib_a)
68 rm -f $(PREFIX)/lib/$(lib_so)
69 rm -f $(PREFIX)/lib/$(linkname)
70 rm -f $(PREFIX)/lib/$(soname)
71 rm -f $(PREFIX)/include/drawtext.h
74 .PHONY: both
75 both:
76 ./configure --disable-freetype
77 $(MAKE) cleanobj
78 $(MAKE)
79 ./configure --enable-freetype
80 $(MAKE) cleanobj
81 $(MAKE)
83 .PHONY: both-install
84 both-install:
85 ./configure --disable-freetype
86 $(MAKE) cleanobj
87 $(MAKE) install
88 ./configure --enable-freetype
89 $(MAKE) cleanobj
90 $(MAKE) install
91 $(MAKE) cleanobj