nuclear@0: PREFIX = /usr/local nuclear@0: dbg = -g nuclear@0: nuclear@0: src = $(wildcard src/*.c) nuclear@0: obj = $(src:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: name = packvfs nuclear@0: nuclear@0: somajor = 0 nuclear@0: sominor = 1 nuclear@0: nuclear@0: lib_a = lib$(name).a nuclear@0: nuclear@0: ifeq ($(shell uname -s), Darwin) nuclear@0: lib_so = lib$(name).dylib nuclear@0: shared = -dynamiclib nuclear@0: else nuclear@0: pic = -fPIC nuclear@0: devlink = lib$(name).so nuclear@0: soname = $(devlink).$(somajor) nuclear@0: lib_so = $(soname).$(sominor) nuclear@0: shared = -shared -Wl,-soname=$(soname) nuclear@0: endif nuclear@0: nuclear@0: CFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) nuclear@0: nuclear@0: $(lib_so): $(obj) nuclear@0: $(CC) -o $@ $(shared) $(obj) $(LDFLAGS) nuclear@0: nuclear@0: $(lib_a): $(obj) nuclear@0: $(AR) rcs $@ $(obj) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(lib_a)