nuclear@0: src = $(wildcard src/*.c) nuclear@0: hdr = src/track.h src/anim.h src/config.h nuclear@0: obj = $(src:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: lib_a = libanim.a nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: lib_so = anim.dylib nuclear@0: shared = -dynamiclib nuclear@0: else nuclear@0: somajor = 0 nuclear@0: sominor = 1 nuclear@0: soname = libanim.so.$(somajor) nuclear@0: lib_so = $(soname).$(sominor) nuclear@0: solink = libanim.so nuclear@0: shared = -shared -Wl,-soname,$(soname) nuclear@0: endif nuclear@0: nuclear@0: nuclear@0: CC = gcc nuclear@0: AR = ar nuclear@0: CFLAGS = $(opt) $(dbg) -pedantic -Wall -fPIC -I$(PREFIX)/include nuclear@0: LDFLAGS = -L$(PREFIX)/lib -lvmath -lm -lpthread nuclear@0: nuclear@0: .PHONY: all nuclear@0: all: $(lib_a) $(lib_so) nuclear@0: nuclear@0: $(lib_a): $(obj) nuclear@0: $(AR) rcs $@ $(obj) nuclear@0: nuclear@0: $(lib_so): $(obj) nuclear@0: $(CC) $(shared) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: $(lib_a) $(lib_so) nuclear@0: mkdir -p $(PREFIX)/lib $(PREFIX)/include/anim nuclear@0: cp $(lib_a) $(PREFIX)/lib/$(lib_a) nuclear@0: cp $(lib_so) $(PREFIX)/lib/$(lib_so) nuclear@0: [ -n "$(solink)" ] && rm -f $(PREFIX)/lib/$(soname) $(PREFIX)/lib/$(solink) \ nuclear@0: && ln -s $(PREFIX)/lib/$(lib_so) $(PREFIX)/lib/$(soname) \ nuclear@0: && ln -s $(PREFIX)/lib/$(soname) $(PREFIX)/lib/$(solink) \ nuclear@0: || true nuclear@0: cp $(hdr) $(PREFIX)/include/anim/ nuclear@0: nuclear@0: .PHONY: uninstall nuclear@0: uninstall: nuclear@0: rm -f $(PREFIX)/lib/$(lib_a) nuclear@0: rm -f $(PREFIX)/lib/$(lib_so) nuclear@0: rm -f $(PREFIX)/include/anim/*.h nuclear@0: rmdir $(PREFIX)/include/anim nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(lib_so) $(lib_a) nuclear@0: nuclear@0: .PHONY: distclean nuclear@0: distclean: clean nuclear@0: rm -f Makefile