From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- build-0.3/c/gnu/o-l.make | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'build-0.3/c/gnu/o-l.make') diff --git a/build-0.3/c/gnu/o-l.make b/build-0.3/c/gnu/o-l.make index 5e66650..5c93f0a 100644 --- a/build-0.3/c/gnu/o-l.make +++ b/build-0.3/c/gnu/o-l.make @@ -1,6 +1,5 @@ # file : build/c/gnu/o-l.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2004-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include,$(bld_root)/c/gnu/configuration.make) @@ -42,9 +41,13 @@ $(out_base)/%.l.o.clean: else +mingw := $(if $(filter $(c_gnu_target_os),mingw32 mingw64),y,n) + $(out_base)/%.l: ld := $(c_gnu) $(out_base)/%.l: ld_options := $(c_gnu_optimization_options) $(c_gnu_debugging_options) +ifeq ($(mingw),n) $(out_base)/%.l: c_pic_options := -fPIC +endif $(out_base)/%.l: comma_ := , $(out_base)/%.l: expand-l = $(if $(subst n,,$(c_rpath)),\ @@ -56,6 +59,9 @@ $(out_base)/%.l: else $(out_base)/%.l: | $$(dir $$@). endif +ifeq ($(mingw),n) +# Standard version. +# $(call message,ld $@,$(ld) -shared \ $(c_extra_options) $(ld_options) $(c_ld_extra_options) \ -o $(@D)/lib$(basename $(@F)).so -Wl$(comma_)-soname=lib$(basename $(@F)).so \ @@ -63,9 +69,24 @@ $(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs) $(call message,,echo "$(@D)/lib$(basename $(@F)).so" >$@) $(call message,,echo "rpath:$(@D)" >>$@) $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.so %.l,$^))" | xargs -n 1 echo >>$@) +else +# MinGW version. +# + $(call message,ld $@,$(ld) -shared \ +$(c_extra_options) $(ld_options) $(c_ld_extra_options) \ +-o $(@D)/$(basename $(@F)).dll -Wl$(comma_)--out-implib$(comma_)$(@D)/lib$(basename $(@F)).a \ +$(foreach f,$^,$(if $(patsubst %.l,,$f),$f,$(call expand-l,$f))) $(c_extra_libs)) + $(call message,,echo "$(@D)/lib$(basename $(@F)).a" >$@) + $(call message,,echo "rpath:$(@D)" >>$@) + $(call message,,echo "$(patsubst %.l,`cat %.l`,$(filter %.a %.l,$^))" | xargs -n 1 echo >>$@) +endif $(out_base)/%.l.o.clean: +ifeq ($(mingw),n) $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,lib%.so,$(@F)),$(basename $(basename $@))) +else + $(call message,rm $$1,rm -f $$1 $(@D)/$(patsubst %.l.o.clean,%.dll,$(@F)) $(@D)/$(patsubst %.l.o.clean,lib%.a,$(@F)),$(basename $(basename $@))) +endif endif endif -- cgit v1.2.3