libdrawtext

view Makefile.in @ 54:4b5bdd7b2cb8

added the LGPL license
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 15 Sep 2011 13:56:54 +0300
parents
children 5de80fdb40db
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 sharedopt = -shared -Wl,-soname,$(soname)
21 libgl = -lGL -lGLU -lGLEW
22 endif
24 CC = gcc
25 CFLAGS = -pedantic -Wall -g -fPIC $(ft2_cflags)
26 LDFLAGS = $(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 $< >$@
43 .PHONY: clean
44 clean:
45 rm -f $(obj) $(lib_a) $(lib_so)
47 .PHONY: cleandep
48 cleandep:
49 rm -f $(dep)
51 .PHONY: install
52 install: $(lib_a) $(lib_so)
53 mkdir -p $(PREFIX)/lib $(PREFIX)/include
54 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
55 cp $(lib_so) $(PREFIX)/lib/$(lib_so)
56 cp src/drawtext.h $(PREFIX)/include/drawtext.h
57 rm -f $(PREFIX)/lib/$(name).so
58 cd $(PREFIX)/lib && ln -s $(lib_so) $(name).so
61 .PHONY: uninstall
62 uninstall:
63 rm -f $(PREFIX)/lib/$(lib_a)
64 rm -f $(PREFIX)/lib/$(lib_so)
65 rm -f $(PREFIX)/lib/$(name).so
66 rm -f $(PREFIX)/include/drawtext.h