libdrawtext
annotate Makefile.in @ 62:6bbf23363c6c
more macosx fixes
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 20 Sep 2011 15:22:52 +0300 |
parents | bfe431dd1d80 |
children | 805936da8d6b |
rev | line source |
---|---|
nuclear@0 | 1 src = $(wildcard src/*.c) |
nuclear@0 | 2 obj = $(src:.c=.o) |
nuclear@0 | 3 dep = $(obj:.o=.d) |
nuclear@0 | 4 |
nuclear@0 | 5 abi = 0 |
nuclear@0 | 6 rev = 0 |
nuclear@0 | 7 |
nuclear@0 | 8 name = libdrawtext |
nuclear@0 | 9 lib_a = $(name).a |
nuclear@0 | 10 |
nuclear@0 | 11 ifeq ($(shell uname -s), Darwin) |
nuclear@0 | 12 lib_so = $(name).dylib |
nuclear@0 | 13 sharedopt = -dynamiclib |
nuclear@0 | 14 |
nuclear@0 | 15 libgl = -framework OpenGL -lGLEW |
nuclear@0 | 16 else |
nuclear@0 | 17 soname = $(name).so.$(abi) |
nuclear@0 | 18 lib_so = $(soname).$(rev) |
nuclear@10 | 19 linkname = $(name).so |
nuclear@0 | 20 sharedopt = -shared -Wl,-soname,$(soname) |
nuclear@0 | 21 |
nuclear@0 | 22 libgl = -lGL -lGLU -lGLEW |
nuclear@0 | 23 endif |
nuclear@0 | 24 |
nuclear@0 | 25 CC = gcc |
nuclear@0 | 26 CFLAGS = -pedantic -Wall -g -fPIC $(ft2_cflags) |
nuclear@0 | 27 LDFLAGS = $(ft2_libs) $(libgl) |
nuclear@0 | 28 |
nuclear@0 | 29 .PHONY: all |
nuclear@0 | 30 all: $(lib_a) $(lib_so) |
nuclear@0 | 31 |
nuclear@0 | 32 $(lib_a): $(obj) |
nuclear@0 | 33 $(AR) rcs $@ $(obj) |
nuclear@0 | 34 |
nuclear@0 | 35 $(lib_so): $(obj) |
nuclear@0 | 36 $(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 37 |
nuclear@0 | 38 -include $(dep) |
nuclear@0 | 39 |
nuclear@0 | 40 %.d: %.c |
nuclear@0 | 41 @$(CPP) $(CFLAGS) -MM $< >$@ |
nuclear@0 | 42 |
nuclear@0 | 43 |
nuclear@0 | 44 .PHONY: clean |
nuclear@0 | 45 clean: |
nuclear@0 | 46 rm -f $(obj) $(lib_a) $(lib_so) |
nuclear@0 | 47 |
nuclear@0 | 48 .PHONY: cleandep |
nuclear@0 | 49 cleandep: |
nuclear@0 | 50 rm -f $(dep) |
nuclear@0 | 51 |
nuclear@0 | 52 .PHONY: install |
nuclear@0 | 53 install: $(lib_a) $(lib_so) |
nuclear@0 | 54 mkdir -p $(PREFIX)/lib $(PREFIX)/include |
nuclear@0 | 55 cp $(lib_a) $(PREFIX)/lib/$(lib_a) |
nuclear@0 | 56 cp $(lib_so) $(PREFIX)/lib/$(lib_so) |
nuclear@0 | 57 cp src/drawtext.h $(PREFIX)/include/drawtext.h |
nuclear@10 | 58 [ -n "$(linkname)" ] && rm -f $(PREFIX)/lib/$(linkname) || true |
nuclear@10 | 59 [ -n "$(linkname)" ] && cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) || true |
nuclear@0 | 60 |
nuclear@0 | 61 |
nuclear@0 | 62 .PHONY: uninstall |
nuclear@0 | 63 uninstall: |
nuclear@0 | 64 rm -f $(PREFIX)/lib/$(lib_a) |
nuclear@0 | 65 rm -f $(PREFIX)/lib/$(lib_so) |
nuclear@0 | 66 rm -f $(PREFIX)/lib/$(name).so |
nuclear@0 | 67 rm -f $(PREFIX)/include/drawtext.h |