From eb40d20e30a7eaf23da16e32c63101ec05d346f6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 16 Nov 2012 15:22:37 +0000 Subject: [PATCH] probes.h: select by suffix rules * Makefile.in, common.mk, configure.in, win32/Makefile.sub (probes.h): select generating with dtrace or copying dummy file by suffix rules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .gitignore | 2 +- ChangeLog | 5 +++++ Makefile.in | 21 ++++++++++----------- common.mk | 10 +++++++--- configure.in | 6 +++--- win32/Makefile.sub | 9 +++++---- 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 942f849ef2..3c0c35ed7a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.a *.bak *.dSYM +*.dmyh *.dylib *.inc *.log @@ -49,7 +50,6 @@ y.tab.c /config.status /config.status.lineno /configure -/dmyprobes.h /doc/capi /enc.mk /encdb.h diff --git a/ChangeLog b/ChangeLog index d5d0e5a453..71db3172e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Nov 17 00:22:32 2012 Nobuyoshi Nakada + + * Makefile.in, common.mk, configure.in, win32/Makefile.sub (probes.h): + select generating with dtrace or copying dummy file by suffix rules. + Fri Nov 16 19:24:10 2012 Koichi Sasada * thread.c (rb_thread_call_without_gvl2): change the parameter of diff --git a/Makefile.in b/Makefile.in index 5f525011ca..9df9dcbb04 100644 --- a/Makefile.in +++ b/Makefile.in @@ -148,7 +148,7 @@ OBJCOPY = @OBJCOPY@ VCS = @VCS@ VCSUP = @VCSUP@ DTRACE = @DTRACE@ -DTRACE_AVAILABLE = @DTRACE_AVAILABLE@ +DTRACE_EXT = @DTRACE_EXT@ OBJEXT = @OBJEXT@ ASMEXT = S @@ -164,6 +164,9 @@ NEWLINE_C = newline.c MINIPRELUDE_C = miniprelude.c SRC_FILE = $< +OS_SRC_FILE = $< +DEST_FILE = $@ +OS_DEST_FILE = $@ MESSAGE_BEGIN = @for line in MESSAGE_END = ; do echo "$$line"; done @@ -323,17 +326,13 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd @$(ECHO) preprocessing $< $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@ -probes.h: $(DTRACE_AVAILABLE)-dtrace-probes.h +probes.h: probes.$(DTRACE_EXT) -yes-dtrace-probes.h: - @$(ECHO) translating probes $(srcdir)/probes.d - $(Q) $(DTRACE) -o probes.h.tmp -h -s $(srcdir)/probes.d - $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' probes.h.tmp > probes.h - $(Q) $(RM) probes.h.tmp - -no-dtrace-probes.h: $(srcdir)/dmyprobes.h - @$(ECHO) copying dummy probes.h - $(Q) $(CP) $(srcdir)/dmyprobes.h probes.h +.d.h: + @$(ECHO) translating probes $< + $(Q) $(DTRACE) -o $@.tmp -h -s $< + $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' $@.tmp > $@ + $(Q) $(RM) $@.tmp clean-local:: $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \ diff --git a/common.mk b/common.mk index dd49e7d9df..534bc101d7 100644 --- a/common.mk +++ b/common.mk @@ -2,7 +2,7 @@ bin: $(PROGRAM) $(WPROGRAM) lib: $(LIBRUBY) dll: $(LIBRUBY_SO) -.SUFFIXES: .inc .h .c .y .i .d +.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT) # V=0 quiet, V=1 verbose. other values don't work. V = 0 @@ -460,7 +460,7 @@ distclean-platform: clean-platform realclean:: realclean-ext realclean-local realclean-enc realclean-golf realclean-extout realclean-local:: distclean-local - $(Q)$(RM) parse.c parse.h lex.c newline.c revision.h dmyprobes.h + $(Q)$(RM) parse.c parse.h lex.c newline.c revision.h probes.dmyh realclean-ext:: realclean-golf: distclean-golf realclean-capi: PHONY @@ -887,9 +887,13 @@ golf_prelude.c: $(srcdir)/tool/compile_prelude.rb $(RBCONFIG) $(srcdir)/prelude. $(ECHO) generating $@ $(Q) $(COMPILE_PRELUDE) $(srcdir)/golf_prelude.rb $@ -$(srcdir)/dmyprobes.h: {$(srcdir)}probes.d +$(srcdir)/probes.dmyh: {$(srcdir)}probes.d $(BASERUBY) $(srcdir)/tool/gen_dummy_probes.rb $(srcdir)/probes.d > $@ +{$(srcdir)}.dmyh.h: + @$(ECHO) copying dummy $(DEST_FILE) + $(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE) + prereq: incs srcs preludes PHONY preludes: {$(VPATH)}miniprelude.c diff --git a/configure.in b/configure.in index 0be5ad35dd..8560bee456 100644 --- a/configure.in +++ b/configure.in @@ -396,11 +396,11 @@ AS_CASE(["$target_os"], [freebsd*], [DTRACE=] ) if test -n "$DTRACE"; then - DTRACE_AVAILABLE=yes + DTRACE_EXT=d else - DTRACE_AVAILABLE=no + DTRACE_EXT=dmyh fi -AC_SUBST(DTRACE_AVAILABLE) +AC_SUBST(DTRACE_EXT) RUBY_PROG_GNU_LD RUBY_CPPOUTFILE diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 62fa2dffaa..58e97cfe9a 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -291,6 +291,8 @@ DEFAULT_PRELUDES = $(NO_GEM_PRELUDE) DEFAULT_PRELUDES = $(YES_GEM_PRELUDE) !endif +DTRACE_EXT = dmyh + !if !defined(STACK) !if "$(ARCH)" == "x64" || "$(ARCH)" == "ia64" STACK = 0x400000 @@ -331,6 +333,9 @@ INSTALLED_LIST= .installed.list MKMAIN_CMD = mkmain.bat SRC_FILE = $(<:\=/) +OS_SRC_FILE = $(<:/=\) +DEST_FILE = $(@:\=/) +OS_DEST_FILE = $(@:/=\) !if !defined(WINMAINOBJ) WINMAINOBJ = winmain.$(OBJEXT) @@ -1048,10 +1053,6 @@ $(ruby_pc): $(RBCONFIG) lex.c: {$(srcdir)}lex.c.blt copy $(?:/=\) $@ -probes.h: dmyprobes.h - @$(ECHO) copying probes.h - $(Q) $(CP) $(srcdir)\dmyprobes.h probes.h - enc/unicode/name2ctype.h: {$(srcdir)}enc/unicode/name2ctype.h.blt @if not exist $(@D:/=\) md $(@D:/=\) $(ECHO) copying $@