packvfs

view 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 source
1 PREFIX = /usr/local
2 dbg = -g
4 src = $(wildcard src/*.c)
5 obj = $(src:.c=.o)
6 dep = $(obj:.o=.d)
7 name = packvfs
9 somajor = 0
10 sominor = 1
12 lib_a = lib$(name).a
14 ifeq ($(shell uname -s), Darwin)
15 lib_so = lib$(name).dylib
16 shared = -dynamiclib
17 else
18 pic = -fPIC
19 devlink = lib$(name).so
20 soname = $(devlink).$(somajor)
21 lib_so = $(soname).$(sominor)
22 shared = -shared -Wl,-soname=$(soname)
23 endif
25 CFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic)
27 $(lib_so): $(obj)
28 $(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
30 $(lib_a): $(obj)
31 $(AR) rcs $@ $(obj)
33 -include $(dep)
35 .PHONY: clean
36 clean:
37 rm -f $(obj) $(lib_a)