X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=assman;a=blobdiff_plain;f=Makefile;h=b6e21dbc70b2d367537d4f7d022746083c7c7b38;hp=9dfa452318afed5406057b9e7ed022bbf42926ff;hb=53025831f330bce574a82d7be44ef2c4fcb46b77;hpb=8d90197913f1c5d813b43854f5f769bade5296a8 diff --git a/Makefile b/Makefile index 9dfa452..b6e21db 100644 --- a/Makefile +++ b/Makefile @@ -3,25 +3,46 @@ obj = $(src:.c=.o) dep = $(obj:.o=.d) name = assman +so_major = 0 +so_minor = 1 + lib_a = lib$(name).a +lib_so = lib$(name).so.$(so_major).$(so_minor) +soname = lib$(name).so.$(so_major) +devlink = lib$(name).so +shared = -shared -Wl,-soname,$(soname) warn = -pedantic -Wall dbg = -g opt = -O0 +def = -DBUILD_MOD_URL +pic = -fPIC + +CFLAGS = $(warn) $(dbg) $(opt) $(pic) $(def) $(inc) +LDFLAGS = -lpthread -lcurl + +.PHONY: all +all: $(lib_so) $(lib_a) $(soname) $(devlink) -CFLAGS = $(warn) $(dbg) $(opt) $(inc) -LDFLAGS = +$(lib_so): $(obj) + $(CC) -o $@ $(shared) $(obj) $(LDFLAGS) $(lib_a): $(obj) $(AR) rcs $@ $(obj) +$(soname): $(lib_so) + rm -f $@ && ln -s $< $@ + +$(devlink): $(soname) + rm -f $@ && ln -s $< $@ + %.d: %.c @echo "generating depfile $< -> $@" @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ .PHONY: clean clean: - rm -f $(obj) $(bin) + rm -f $(obj) $(lib_a) $(lib_so) $(soname) $(devlink) .PHONY: cleandep cleandep: