libdrawtext
view Makefile.in @ 20:c091833c2354
merged
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 18 Mar 2013 06:06:26 +0200 |
parents | 805936da8d6b |
children | df6d52b36bd6 |
line source
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
5 abi = 0
6 rev = 0
8 name = libdrawtext
9 lib_a = $(name).a
11 ifeq ($(shell uname -s), Darwin)
12 lib_so = $(name).dylib
13 sharedopt = -dynamiclib
15 libgl = -framework OpenGL -lGLEW
16 else
17 soname = $(name).so.$(abi)
18 lib_so = $(soname).$(rev)
19 linkname = $(name).so
20 sharedopt = -shared -Wl,-soname,$(soname)
22 libgl = -lGL -lGLU -lGLEW
23 endif
25 CC = gcc
26 CFLAGS = -pedantic -Wall -g -fPIC -I$(PREFIX)/include $(ft2_cflags)
27 LDFLAGS = -L$(PREFIX)/lib $(ft2_libs) $(libgl)
29 .PHONY: all
30 all: $(lib_a) $(lib_so)
32 $(lib_a): $(obj)
33 $(AR) rcs $@ $(obj)
35 $(lib_so): $(obj)
36 $(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS)
38 -include $(dep)
40 %.d: %.c
41 @$(CPP) $(CFLAGS) -MM $< >$@
44 .PHONY: clean
45 clean:
46 rm -f $(obj) $(lib_a) $(lib_so)
48 .PHONY: cleandep
49 cleandep:
50 rm -f $(dep)
52 .PHONY: install
53 install: $(lib_a) $(lib_so)
54 mkdir -p $(PREFIX)/lib $(PREFIX)/include
55 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
56 cp $(lib_so) $(PREFIX)/lib/$(lib_so)
57 cp src/drawtext.h $(PREFIX)/include/drawtext.h
58 [ -n "$(linkname)" ] && \
59 rm -f $(PREFIX)/lib/$(linkname) $(PREFIX)/lib/$(soname) && \
60 cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) && ln -s $(lib_so) $(soname) || true
63 .PHONY: uninstall
64 uninstall:
65 rm -f $(PREFIX)/lib/$(lib_a)
66 rm -f $(PREFIX)/lib/$(lib_so)
67 rm -f $(PREFIX)/lib/$(linkname)
68 rm -f $(PREFIX)/lib/$(soname)
69 rm -f $(PREFIX)/include/drawtext.h