nuclear@0: src = $(wildcard src/*.c) nuclear@0: obj = $(src:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: nuclear@0: abi = 0 nuclear@0: rev = 0 nuclear@0: nuclear@0: name = libdrawtext nuclear@0: lib_a = $(name).a nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: lib_so = $(name).dylib nuclear@0: sharedopt = -dynamiclib nuclear@0: nuclear@0: libgl = -framework OpenGL -lGLEW nuclear@0: else nuclear@0: soname = $(name).so.$(abi) nuclear@0: lib_so = $(soname).$(rev) nuclear@10: linkname = $(name).so nuclear@0: sharedopt = -shared -Wl,-soname,$(soname) nuclear@0: nuclear@0: libgl = -lGL -lGLU -lGLEW nuclear@0: endif nuclear@0: nuclear@0: CC = gcc nuclear@11: CFLAGS = -pedantic -Wall -g -fPIC -I$(PREFIX)/include $(ft2_cflags) nuclear@11: LDFLAGS = -L$(PREFIX)/lib $(ft2_libs) $(libgl) 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) $(sharedopt) -o $@ $(obj) $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) -MM $< >$@ nuclear@0: nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(lib_a) $(lib_so) nuclear@0: nuclear@0: .PHONY: cleandep nuclear@0: cleandep: nuclear@0: rm -f $(dep) nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: $(lib_a) $(lib_so) nuclear@0: mkdir -p $(PREFIX)/lib $(PREFIX)/include nuclear@0: cp $(lib_a) $(PREFIX)/lib/$(lib_a) nuclear@0: cp $(lib_so) $(PREFIX)/lib/$(lib_so) nuclear@0: cp src/drawtext.h $(PREFIX)/include/drawtext.h nuclear@11: [ -n "$(linkname)" ] && rm -f $(PREFIX)/lib/$(linkname) \ nuclear@11: && cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) \ nuclear@11: && ln -s $(lib_so) $(soname) || true nuclear@0: 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@11: rm -f $(PREFIX)/lib/$(linkname) nuclear@11: rm -f $(PREFIX)/lib/$(soname) nuclear@0: rm -f $(PREFIX)/include/drawtext.h