diff options
Diffstat (limited to 'enc')
-rw-r--r-- | enc/depend | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/enc/depend b/enc/depend index f5aa76ef7b..7186179ef0 100644 --- a/enc/depend +++ b/enc/depend @@ -1,3 +1,5 @@ +% CONFIG["DLDFLAGS"].sub!(/(\A|\s)(-\S+(?:\s*\w*)?\$\(TARGET\)\S*)/, '\1') +% dldflags = $2 % enable_shared = CONFIG['ENABLE_SHARED'] == 'yes' % deffile = (true if /\$\(DEFFILE\)/ =~ CONFIG["LINK_SO"]) % encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS @@ -103,12 +105,17 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma. % obj = "enc/#{e}.$(OBJEXT)" % df = ("enc/#{e}.def" if deffile) $(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%> +% cmd = link_so.sub(/\$\(OBJS\)/) {obj} +% base = File.basename(e) +% cmd.sub!(/(?=\$\(DLDFLAGS\))/) {dldflags.sub(/\$\(TARGET\)/) {base} + " "} if dldflags % if df echo> <%=df%> EXPORTS - echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> + echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=base%> +% cmd.sub!(/\$\(DEFFILE\)/) {df} +% cmd.gsub!(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"} % end @$(MAKEDIRS) "$(@D)" - <%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%> + <%=cmd%> % end % dependencies.each do |e| |