diff --git a/ChangeLog b/ChangeLog index 22d130a6d0..ce30b7d9b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Tue Mar 23 14:31:47 2004 Nobuyoshi Nakada + + * Makefile.in, */Makefile.sub, common.mk (clean-local, distclean-local): + separate files under directories due to directory separator. + + * */Makefile.sub (MKFILES): common.mk and */Makefile.sub should not be + removed. + + * win32/Makefile.sub, wince/Makefile.sub: $* cannot appear in explicit + rules. + + * cygwin/GNUmakefile.in: some mingw stuffs were missed. + + * lib/mkmf.rb (create_makefile): Borland make wrongly removes braces + from command lines. + Mon Mar 22 08:21:17 2004 Nobuyoshi Nakada * Makefile.in, */Makefile.sub, common.mk: extract common portions. diff --git a/Makefile.in b/Makefile.in index 6bd888c887..1632a3ac22 100644 --- a/Makefile.in +++ b/Makefile.in @@ -116,6 +116,7 @@ $(LIBRUBY_SO): @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \ File.symlink "$(LIBRUBY_SO)", link}' \ $(LIBRUBY_ALIASES) || true + fake.rb: Makefile @echo ' \ class Object; \ @@ -166,3 +167,8 @@ lex.c: keywords .c.@OBJEXT@: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< +clean-local:: + @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) + +distclean-local:: + @$(RM) ext/config.cache $(RBCONFIG) diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index 2ca5ea0c3d..c579ac9ed2 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -1,7 +1,7 @@ # -*- makefile -*- SHELL = $(COMSPEC) -MKFILES = Makefile $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk +MKFILES = Makefile #### Start of system configuration section. #### OS = bccwin32 @@ -186,7 +186,7 @@ WINMAINOBJ = winmain.$(OBJEXT) sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F) @del y.tab.c -all: +all: $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk !include $(srcdir)/common.mk @@ -271,11 +271,12 @@ config.h: \#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)" | -config.status: $(MKFILES) +config.status: $(MKFILES) $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk @echo Creating $@ @type > $@ &&| # Generated automatically by Makefile.sub. s,@SHELL@,$$(COMSPEC),;t t +s,@PATH_SEPARATOR@,;,;t t s,@CFLAGS@,$(CFLAGS),;t t s,@CPPFLAGS@,$(CPPFLAGS),;t t s,@CXXFLAGS@,$(CXXFLAGS),;t t @@ -403,8 +404,15 @@ $(LIBRUBY): $(LIBRUBY_SO) $(RUBYDEF): $(LIBRUBY_A) $(PREP) $(MINIRUBY) $(srcdir)win32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A) +$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb + @$(MINIRUBY) $(srcdir)win32/resource.rb \ + -ruby_name=$(RUBY_INSTALL_NAME) \ + -rubyw_name=$(RUBYW_INSTALL_NAME) \ + -so_name=$(RUBY_SO_NAME) \ + . $(icondirs) $(srcdir)win32 + clean-local:: - @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? + @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib @$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res distclean-local:: diff --git a/common.mk b/common.mk index 35abb53472..44221a821d 100644 --- a/common.mk +++ b/common.mk @@ -99,19 +99,18 @@ install-doc: $(PROGRAM) clean: clean-ext clean-local clean-local:: - @$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) - @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) dmyext.$(OBJEXT) - @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) + @$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES) + @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) clean-ext: @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) clean distclean: distclean-ext distclean-local distclean-local:: clean-local - @$(RM) $(MKFILES) config.h rbconfig.rb $(RBCONFIG) - @$(RM) ext/config.cache config.cache config.log config.status + @$(RM) $(MKFILES) config.h rbconfig.rb + @$(RM) config.cache config.log config.status @$(RM) *~ *.bak *.stackdump core *.core gmon.out y.tab.c y.output ruby.imp distclean-ext: - @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean 2> $(NULL) + @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean realclean:: distclean @$(RM) parse.c lex.c diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in index d7e951ca64..fe6fd3b859 100644 --- a/cygwin/GNUmakefile.in +++ b/cygwin/GNUmakefile.in @@ -1,11 +1,14 @@ include Makefile ENABLE_SHARED=@ENABLE_SHARED@ +DLLWRAP = @DLLWRAP@ --target=@target_os@ ifeq (@target_os@,cygwin) DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO)) else DLL_BASE_NAME := $(RUBY_SO_NAME) + DLLWRAP += -mno-cygwin + VPATH += $(srcdir)/win32 endif ifneq ($(ENABLE_SHARED),yes) @@ -44,7 +47,7 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@ $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@ $(RUBY_EXP): $(LIBRUBY_A) - @DLLWRAP@ --target=@target_os@ --driver-name=$(CC) \ + $(DLLWRAP) \ --output-exp=$(RUBY_EXP) \ --export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM) $(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM) diff --git a/ext/extmk.rb b/ext/extmk.rb index 4abe6a119d..94c091728f 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -116,6 +116,9 @@ def extmake(target) unless system($make, *args) $ignore or $continue or return false end + if $clean and $clean != true + File.unlink(makefile) rescue nil + end if $static $extflags ||= "" $extlibs ||= [] @@ -215,11 +218,11 @@ parse_args() if target = ARGV.shift and /^[a-z-]+$/ =~ target $mflags.push(target) - target = target.sub(/^(?:dist|real)(?=(?:clean)?$)/, '\1') + target = target.sub(/^(dist|real)(?=(?:clean)?$)/, '') case target when /clean/ $ignore ||= true - $clean = true + $clean = $1 ? $1[0] : true when /^install\b/ $install = true $ignore ||= true diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 7ebd28941d..ba9f90c4f4 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -897,8 +897,9 @@ RUBYLIBDIR = $(sitelibdir)$(target_prefix) RUBYARCHDIR = $(sitearchdir)$(target_prefix) } end + n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).' mfile.print %{ -CLEANLIBS = #{$extout ? '$(RUBYARCHDIR)/' : ''}$(TARGET).{#{CONFIG['DLEXT']},il?,tds,map} +CLEANLIBS = #{n}#{CONFIG['DLEXT']} #{n}il? #{n}tds #{n}map CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.exp *.bak all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"} @@ -1024,8 +1025,8 @@ def init_mkmf(config = CONFIG) $LOCAL_LIBS = "" - $cleanfiles = [] - $distcleanfiles = [] + $cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || [] + $distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || [] $extout ||= nil $extout_prefix ||= nil diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 198f8e81d6..f8d0d51f0d 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1,7 +1,7 @@ # -*- makefile -*- SHELL = $(COMSPEC) -MKFILES = Makefile $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk +MKFILES = Makefile NULL = nul #### Start of system configuration section. #### @@ -171,7 +171,7 @@ DLDOBJS = WINMAINOBJ = winmain.$(OBJEXT) -all: +all: $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk !include $(srcdir)/common.mk @@ -271,10 +271,11 @@ config.h: #define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)" <%))' + Default of the install directory is /usr . (2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile})) if you want to change the name of the executable files. @@ -79,9 +80,9 @@ in Japanese, but you can download at least. C: cd \ruby - win32\configure + win32\configure --prefix=/usr/local nmake - nmake DESTDIR=/usr/local install + nmake install * Build on the relative directory from the ruby source directory. @@ -94,9 +95,9 @@ in Japanese, but you can download at least. cd \ruby mkdir mswin32 cd mswin32 - ..\win32\configure + ..\win32\configure --prefix=/usr/local nmake - nmake DESTDIR=/usr/local install + nmake install * Build on the different drive. @@ -107,9 +108,9 @@ in Japanese, but you can download at least. D: cd D:\build\ruby - C:\src\ruby\win32\configure + C:\src\ruby\win32\configure --prefix=C:/usr/local nmake - nmake DESTDIR=C:/usr/local install + nmake install == Bugs