ruby-changes:51968
From: k0kubun <ko1@a...>
Date: Sun, 5 Aug 2018 00:12:36 +0900 (JST)
Subject: [ruby-changes:51968] k0kubun:r64182 (trunk): common.mk: stop building MJIT min header for mswin
k0kubun 2018-08-05 00:12:30 +0900 (Sun, 05 Aug 2018) New Revision: 64182 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64182 Log: common.mk: stop building MJIT min header for mswin Since it's impossible to leave macro when preprocessing C source file with cl.exe, I decided to create precompiled header on Ruby's build time instead. We're not doing it for non-mswin environment for 2 reasons: 1) Precompiled header may not be able to be used when CC is upgraded. 2) We need to create as many precompiled headers as the patterns of compile options. (Probably only 2, for with and without --jit-debug) I'll ignore them for mswin for now, and solve it later by including CC version and --jit-debug information in precompiled header filename. After that, non-mswin environment may follow it to simplify build system. Makefile.in: ditto Modified files: trunk/Makefile.in trunk/common.mk Index: common.mk =================================================================== --- common.mk (revision 64181) +++ common.mk (revision 64182) @@ -61,10 +61,6 @@ ENC_TRANS_D = $(TIMESTAMPDIR)/.enc-tra https://github.com/ruby/ruby/blob/trunk/common.mk#L61 RDOCOUT = $(EXTOUT)/rdoc HTMLOUT = $(EXTOUT)/html CAPIOUT = doc/capi -MJIT_HEADER = rb_mjit_header.h -MJIT_MIN_HEADER_NAME = rb_mjit_min_header-$(RUBY_PROGRAM_VERSION).h -MJIT_MIN_HEADER = $(MJIT_HEADER_BUILD_DIR)/$(MJIT_MIN_HEADER_NAME) -MJIT_HEADER_BUILD_DIR = $(EXTOUT)/include/$(arch) INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT) NORMALMAINOBJ = main.$(OBJEXT) @@ -201,32 +197,15 @@ MAKE_LINK = $(MINIRUBY) -rfileutils -e " https://github.com/ruby/ruby/blob/trunk/common.mk#L197 all: $(SHOWFLAGS) main docs -main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs $(MJIT_MIN_HEADER) +main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs @$(NULLCMD) .PHONY: mjit-headers -mjit-headers: $(MJIT_MIN_HEADER) mjit_config.h +mjit-headers: mjit_config.h mjit.$(OBJEXT): mjit_config.h mjit_config.h: Makefile -# Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb. -# So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated. -$(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) - $(ECHO) building $(@F:.time=.h) - $(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new - $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new - -$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time - -$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time -$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(srcdir)/tool/transform_mjit_header.rb $(PREP) -$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h - $(ECHO) building $@ - $(MINIRUBY) $(srcdir)/tool/transform_mjit_header.rb "$(CC) $(ARCH_FLAG)" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@ - $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR) - $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F) - .PHONY: showflags exts enc trans: $(SHOWFLAGS) showflags: @@ -575,11 +554,6 @@ clean-local:: clean-runnable https://github.com/ruby/ruby/blob/trunk/common.mk#L554 $(Q)$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) dmyenc.$(OBJEXT) $(ARCHFILE) .*.time $(Q)$(RM) y.tab.c y.output encdb.h transdb.h config.log rbconfig.rb $(ruby_pc) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT) $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D) - $(Q)$(RM) $(MJIT_HEADER) $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h - $(Q)$(RM) $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h - $(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_min_header-*.h - $(Q)$(RM) $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time mjit_config.h - -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) 2> $(NULL) || exit 0 -$(Q) $(RMDIR) enc/jis enc/trans enc 2> $(NULL) || exit 0 clean-runnable:: PHONY $(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || exit 0 Index: Makefile.in =================================================================== --- Makefile.in (revision 64181) +++ Makefile.in (revision 64182) @@ -54,6 +54,7 @@ INSTALLDOC = @INSTALLDOC@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L54 DOCTARGETS = @RDOCTARGET@ @CAPITARGET@ EXTOUT = @EXTOUT@ +TIMESTAMPDIR = $(EXTOUT)/.timestamp arch_hdrdir = $(EXTOUT)/include/$(arch) VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/missing @@ -84,6 +85,10 @@ MJIT_OPTFLAGS = @MJIT_OPTFLAGS@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L85 MJIT_DEBUGFLAGS = @MJIT_DEBUGFLAGS@ MJIT_LDSHARED = @MJIT_LDSHARED@ MJIT_DLDFLAGS = @DLDFLAGS@ +MJIT_HEADER = rb_mjit_header.h +MJIT_MIN_HEADER_NAME = rb_mjit_min_header-$(RUBY_PROGRAM_VERSION).h +MJIT_MIN_HEADER = $(MJIT_HEADER_BUILD_DIR)/$(MJIT_MIN_HEADER_NAME) +MJIT_HEADER_BUILD_DIR = $(EXTOUT)/include/$(arch) LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXTLDFLAGS = @EXTLDFLAGS@ XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) @@ -429,6 +434,32 @@ probes.$(OBJEXT): $(srcdir)/probes.d $(D https://github.com/ruby/ruby/blob/trunk/Makefile.in#L434 $(Q) $(RM) $@ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS) +main: $(MJIT_MIN_HEADER) +mjit-headers: $(MJIT_MIN_HEADER) +clean-local:: + $(Q)$(RM) $(MJIT_HEADER) $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h + $(Q)$(RM) $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h + $(Q)$(RM) $(MJIT_HEADER_INSTALL_DIR)/rb_mjit_min_header-*.h + $(Q)$(RM) $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time mjit_config.h + -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) 2> $(NULL) || exit 0 + +# Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb. +# So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated. +$(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) + $(ECHO) building $(@F:.time=.h) + $(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new + $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new + +$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time + +$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time +$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(srcdir)/tool/transform_mjit_header.rb $(PREP) +$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h + $(ECHO) building $@ + $(MINIRUBY) $(srcdir)/tool/transform_mjit_header.rb "$(CC) $(ARCH_FLAG)" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@ + $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR) + $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F) + # DTrace static library hacks described here: # http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html ruby-glommed.$(OBJEXT): -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/