projects
/
assman
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mod_url progress
[assman]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
9dfa452
..
c3abbe7
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-3,25
+3,46
@@
obj = $(src:.c=.o)
dep = $(obj:.o=.d)
name = assman
dep = $(obj:.o=.d)
name = assman
+so_major = 0
+so_minor = 1
+
lib_a = lib$(name).a
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
warn = -pedantic -Wall
dbg = -g
opt = -O0
+def = -DBUILD_MOD_URL
+pic = -fPIC
+
+CFLAGS = $(warn) $(dbg) $(opt) $(pic) $(def) $(inc) -pthread
+LDFLAGS = -pthread -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)
$(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:
%.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:
.PHONY: cleandep
cleandep: