Skip to content

Commit

Permalink
* Makefile.in, */Makefile.sub, common.mk (clean-local, distclean-local):
Browse files Browse the repository at this point in the history
  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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 23, 2004
1 parent 69d80a3 commit 52a67fe
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 44 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Tue Mar 23 14:31:47 2004 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* Makefile.in, */Makefile.sub, common.mk: extract common portions.
Expand Down
6 changes: 6 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down Expand Up @@ -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)
16 changes: 12 additions & 4 deletions bcc32/Makefile.sub
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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::
Expand Down
11 changes: 5 additions & 6 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion cygwin/GNUmakefile.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions ext/extmk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||= []
Expand Down Expand Up @@ -215,11 +218,11 @@ def $mflags.defined?(var)

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
Expand Down
7 changes: 4 additions & 3 deletions lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,9 @@ def create_makefile(target, srcprefix = nil)
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"}
Expand Down Expand Up @@ -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
Expand Down
26 changes: 15 additions & 11 deletions win32/Makefile.sub
Original file line number Diff line number Diff line change
@@ -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. ####
Expand Down Expand Up @@ -171,7 +171,7 @@ DLDOBJS =

WINMAINOBJ = winmain.$(OBJEXT)

all:
all: $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk

!include $(srcdir)/common.mk

Expand Down Expand Up @@ -271,10 +271,11 @@ config.h:
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
<<KEEP

config.status: $(MKFILES)
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
@echo Creating <<$@
# 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
Expand Down Expand Up @@ -366,6 +367,7 @@ s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS
s,@COMMON_LIBS@,m,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
s,@DISTCLEANFILES@,vc*.pdb,;t t
s,@EXPORT_PREFIX@, ,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
Expand All @@ -380,24 +382,26 @@ miniruby$(EXEEXT):
@echo. $(LIBS)
$(PURIFY) $(CC) $(MAINOBJ) $(LIBRUBY_A) $(LIBS) -Fe$@ $(LDFLAGS)

$(PROGRAM): $*.res
$(PURIFY) $(CC) $(MAINOBJ) $*.res \
$(PROGRAM): $(RUBY_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS)

$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res
$(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) $*.res \
$(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
$(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
$(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
$(LDFLAGS) $(XLDFLAGS) -subsystem:Windows

$(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(AR) $(ARFLAGS)$@ $(OBJS) $(DMYEXT)

$(LIBRUBY): $(RUBYDEF)
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)

$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $*.res
$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo. $(DLDOBJS)
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
-Fe$@ $(LDFLAGS) $(LIBRUBY_DLDFLAGS)
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
$(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
$(LIBRUBY_DLDFLAGS)

$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
Expand Down
4 changes: 2 additions & 2 deletions win32/rm.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@echo off
::: $Id$
::: $Id: rm.bat,v 1.1 2004/03/21 23:21:30 nobu Exp $
if "%1" == "-f" shift
:begin
if "%1" == "" goto :end
if exist %1 del %1
if exist "%1" del "%1"
shift
goto :begin
:end
14 changes: 8 additions & 6 deletions wince/Makefile.sub
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- makefile -*-

SHELL = $(COMSPEC)
MKFILES = Makefile $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
MKFILES = Makefile
NULL = nul

#### Start of system configuration section. ####
Expand Down Expand Up @@ -178,7 +178,7 @@ DLDOBJS =

WINMAINOBJ = wincemain.$(OBJEXT)

all:
all: $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
Expand Down Expand Up @@ -297,10 +297,11 @@ $(BANG)endif
#endif
<<KEEP

config.status: $(MKFILES)
config.status: $(MKFILES) $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
@echo Creating <<$@
# 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
Expand Down Expand Up @@ -412,10 +413,11 @@ $(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(LIBRUBY): $(RUBYDEF)
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)

$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $*.res
$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo. $(DLDOBJS)
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
-Fe$@ $(LDFLAGS) $(LIBRUBY_DLDFLAGS)
$(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
$(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
$(LIBRUBY_DLDFLAGS)

$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb \
Expand Down
19 changes: 10 additions & 9 deletions wince/README.wince
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

(1) eMbedded Visual C++ 3.0 or later.

(2) If you want to run `((%nmake clean%))' or `((%nmake distclean%))'
properly, you must install UNIX compatible `((%rm%))' command on
your ((|PATH|)) if you want to clean after compile.
(2) ruby executable on the compiling host environment.

(3) Please set environment variable (({INCLUDE})), (({LIB})), (({PATH})),
(({CE_TOOLS_DIR})), (({EMBEDDED_TOOLS_DIR})) to run required commands
Expand All @@ -25,6 +23,9 @@
(1) Execute wince\configure.bat on your build directory.
You can specify the target platform as an argument.
For example, run `((%configure arm-hpc2k-wince%))'
You can also specify the install directory.
For example, run `((%configure --prefix=<install_directory>%))'
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.
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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

Expand Down

0 comments on commit 52a67fe

Please sign in to comment.