packvfs

annotate Makefile @ 0:df5e9ee65a50

packvfs initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 02 Aug 2013 06:03:38 +0300
parents
children dc23ab0545a6
rev   line source
nuclear@0 1 PREFIX = /usr/local
nuclear@0 2 dbg = -g
nuclear@0 3
nuclear@0 4 src = $(wildcard src/*.c)
nuclear@0 5 obj = $(src:.c=.o)
nuclear@0 6 dep = $(obj:.o=.d)
nuclear@0 7 name = packvfs
nuclear@0 8
nuclear@0 9 somajor = 0
nuclear@0 10 sominor = 1
nuclear@0 11
nuclear@0 12 lib_a = lib$(name).a
nuclear@0 13
nuclear@0 14 ifeq ($(shell uname -s), Darwin)
nuclear@0 15 lib_so = lib$(name).dylib
nuclear@0 16 shared = -dynamiclib
nuclear@0 17 else
nuclear@0 18 pic = -fPIC
nuclear@0 19 devlink = lib$(name).so
nuclear@0 20 soname = $(devlink).$(somajor)
nuclear@0 21 lib_so = $(soname).$(sominor)
nuclear@0 22 shared = -shared -Wl,-soname=$(soname)
nuclear@0 23 endif
nuclear@0 24
nuclear@0 25 CFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic)
nuclear@0 26
nuclear@0 27 $(lib_so): $(obj)
nuclear@0 28 $(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
nuclear@0 29
nuclear@0 30 $(lib_a): $(obj)
nuclear@0 31 $(AR) rcs $@ $(obj)
nuclear@0 32
nuclear@0 33 -include $(dep)
nuclear@0 34
nuclear@0 35 .PHONY: clean
nuclear@0 36 clean:
nuclear@0 37 rm -f $(obj) $(lib_a)