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@78: sys := $(patsubst MINGW32%,MINGW32,$(shell uname -s)) nuclear@78: ifeq ($(sys), Darwin) nuclear@33: lib_so = libanim.dylib nuclear@0: shared = -dynamiclib nuclear@78: else ifeq ($(sys), MINGW32) nuclear@78: lib_so = libanim.dll nuclear@78: shared = -shared 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@78: pic = -fPIC nuclear@0: endif nuclear@0: nuclear@0: nuclear@0: CC = gcc nuclear@0: AR = ar nuclear@78: CFLAGS = $(opt) $(dbg) -pedantic -Wall $(pic) -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