packvfs
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Fri Aug 02 06:03:38 2013 +0300 1.3 @@ -0,0 +1,37 @@ 1.4 +PREFIX = /usr/local 1.5 +dbg = -g 1.6 + 1.7 +src = $(wildcard src/*.c) 1.8 +obj = $(src:.c=.o) 1.9 +dep = $(obj:.o=.d) 1.10 +name = packvfs 1.11 + 1.12 +somajor = 0 1.13 +sominor = 1 1.14 + 1.15 +lib_a = lib$(name).a 1.16 + 1.17 +ifeq ($(shell uname -s), Darwin) 1.18 + lib_so = lib$(name).dylib 1.19 + shared = -dynamiclib 1.20 +else 1.21 + pic = -fPIC 1.22 + devlink = lib$(name).so 1.23 + soname = $(devlink).$(somajor) 1.24 + lib_so = $(soname).$(sominor) 1.25 + shared = -shared -Wl,-soname=$(soname) 1.26 +endif 1.27 + 1.28 +CFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) 1.29 + 1.30 +$(lib_so): $(obj) 1.31 + $(CC) -o $@ $(shared) $(obj) $(LDFLAGS) 1.32 + 1.33 +$(lib_a): $(obj) 1.34 + $(AR) rcs $@ $(obj) 1.35 + 1.36 +-include $(dep) 1.37 + 1.38 +.PHONY: clean 1.39 +clean: 1.40 + rm -f $(obj) $(lib_a)