diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/gcc-linux.mk | 29 | ||||
-rw-r--r-- | make/libtool.mk | 8 | ||||
-rw-r--r-- | make/mingw.mk | 10 |
3 files changed, 32 insertions, 15 deletions
diff --git a/make/gcc-linux.mk b/make/gcc-linux.mk index 41978402..d773de4e 100644 --- a/make/gcc-linux.mk +++ b/make/gcc-linux.mk @@ -5,7 +5,7 @@ LOBJ=o # Usage: $(call libname,base) define libname -lib$(1).a lib$(1).so +lib$(1).so endef # Usage: $(call binname,base) @@ -41,22 +41,25 @@ define libcompile endef +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + ar cru $(2) $(1) + ranlib $(2) +endef + # 1 2 3 4 5 # Usage: $(call makelib,objs,library,current,revision,age) define makelib $(RM) $2 - if [ "$(findstring .a,$(2))" = ".a" ]; then \ - ar cru $(2) $(1); \ - ranlib $(2); \ - else \ - major=$$(( $(3) - $(5))); \ - versuffix=$$major.$5.$4; \ - $(CXX) $(CXXFLAGS) -shared -o $(2).$$versuffix $(1) \ - -Wl,--soname -Wl,`basename $(2)`.$$major \ - $(LDFLAGS) $(LIBS); \ - ln -s `basename $(2)`.$$versuffix $(2); \ - ln -s `basename $(2)`.$$versuffix $(2).$$major; \ - fi + major=$$(( $(3) - $(5))); \ + versuffix=$$major.$5.$4; \ + $(CXX) $(CXXFLAGS) -shared -o $(2).$$versuffix $(1) \ + -Wl,--soname -Wl,`basename $(2)`.$$major \ + $(LDFLAGS) $(LIBS); \ + ln -s `basename $(2)`.$$versuffix $(2); \ + ln -s `basename $(2)`.$$versuffix $(2).$$major endef # 1 2 diff --git a/make/libtool.mk b/make/libtool.mk index 3287d5aa..b9fda1d5 100644 --- a/make/libtool.mk +++ b/make/libtool.mk @@ -57,6 +57,14 @@ define libcompile $(call fixdeps,$(basename $(call src_to_obj,$(1)))) endef +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + ar cru $(2) $(1) + ranlib $(2) +endef + # 1 2 3 4 5 # Usage: $(call makelib,objs,library,current,revision,age) define makelib diff --git a/make/mingw.mk b/make/mingw.mk index 04798c55..21c3cb56 100644 --- a/make/mingw.mk +++ b/make/mingw.mk @@ -35,11 +35,17 @@ endef libcompile = $(compile) +# 1 2 +# Usage: $(call makeslib,objs,library) +define makeslib + $(RM) $2 + ar cru $(2) $(1) + ranlib $(2) +endef + # 1 2 3 4 5 # Usage: $(call makelib,objs,library,current,revision,age) define makelib - ar cru $(2) $(1); - ranlib $(2); echo `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll dlltool -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll) $(1); \ $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll \ |