libanim
annotate Makefile.in @ 60:8f7193d00555
set/get currently active animation name and minor enhancements in the example
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 27 Dec 2013 11:29:42 +0200 |
parents | |
children | f12663c5c907 |
rev | line source |
---|---|
nuclear@0 | 1 src = $(wildcard src/*.c) |
nuclear@0 | 2 hdr = src/track.h src/anim.h src/config.h |
nuclear@0 | 3 obj = $(src:.c=.o) |
nuclear@0 | 4 dep = $(obj:.o=.d) |
nuclear@0 | 5 lib_a = libanim.a |
nuclear@0 | 6 |
nuclear@0 | 7 ifeq ($(shell uname -s), Darwin) |
nuclear@0 | 8 lib_so = anim.dylib |
nuclear@0 | 9 shared = -dynamiclib |
nuclear@0 | 10 else |
nuclear@0 | 11 somajor = 0 |
nuclear@0 | 12 sominor = 1 |
nuclear@0 | 13 soname = libanim.so.$(somajor) |
nuclear@0 | 14 lib_so = $(soname).$(sominor) |
nuclear@0 | 15 solink = libanim.so |
nuclear@0 | 16 shared = -shared -Wl,-soname,$(soname) |
nuclear@0 | 17 endif |
nuclear@0 | 18 |
nuclear@0 | 19 |
nuclear@0 | 20 CC = gcc |
nuclear@0 | 21 AR = ar |
nuclear@0 | 22 CFLAGS = $(opt) $(dbg) -pedantic -Wall -fPIC -I$(PREFIX)/include |
nuclear@0 | 23 LDFLAGS = -L$(PREFIX)/lib -lvmath -lm -lpthread |
nuclear@0 | 24 |
nuclear@0 | 25 .PHONY: all |
nuclear@0 | 26 all: $(lib_a) $(lib_so) |
nuclear@0 | 27 |
nuclear@0 | 28 $(lib_a): $(obj) |
nuclear@0 | 29 $(AR) rcs $@ $(obj) |
nuclear@0 | 30 |
nuclear@0 | 31 $(lib_so): $(obj) |
nuclear@0 | 32 $(CC) $(shared) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 33 |
nuclear@0 | 34 -include $(dep) |
nuclear@0 | 35 |
nuclear@0 | 36 %.d: %.c |
nuclear@0 | 37 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 38 |
nuclear@0 | 39 .PHONY: install |
nuclear@0 | 40 install: $(lib_a) $(lib_so) |
nuclear@0 | 41 mkdir -p $(PREFIX)/lib $(PREFIX)/include/anim |
nuclear@0 | 42 cp $(lib_a) $(PREFIX)/lib/$(lib_a) |
nuclear@0 | 43 cp $(lib_so) $(PREFIX)/lib/$(lib_so) |
nuclear@0 | 44 [ -n "$(solink)" ] && rm -f $(PREFIX)/lib/$(soname) $(PREFIX)/lib/$(solink) \ |
nuclear@0 | 45 && ln -s $(PREFIX)/lib/$(lib_so) $(PREFIX)/lib/$(soname) \ |
nuclear@0 | 46 && ln -s $(PREFIX)/lib/$(soname) $(PREFIX)/lib/$(solink) \ |
nuclear@0 | 47 || true |
nuclear@0 | 48 cp $(hdr) $(PREFIX)/include/anim/ |
nuclear@0 | 49 |
nuclear@0 | 50 .PHONY: uninstall |
nuclear@0 | 51 uninstall: |
nuclear@0 | 52 rm -f $(PREFIX)/lib/$(lib_a) |
nuclear@0 | 53 rm -f $(PREFIX)/lib/$(lib_so) |
nuclear@0 | 54 rm -f $(PREFIX)/include/anim/*.h |
nuclear@0 | 55 rmdir $(PREFIX)/include/anim |
nuclear@0 | 56 |
nuclear@0 | 57 .PHONY: clean |
nuclear@0 | 58 clean: |
nuclear@0 | 59 rm -f $(obj) $(lib_so) $(lib_a) |
nuclear@0 | 60 |
nuclear@0 | 61 .PHONY: distclean |
nuclear@0 | 62 distclean: clean |
nuclear@0 | 63 rm -f Makefile |