Re: [GIT PULL v5] Trial of labeling lines in code snippets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 05, 2018 at 09:35:08AM -0700, Paul E. McKenney wrote:
> On Sun, Aug 05, 2018 at 09:06:27AM +0900, Akira Yokosawa wrote:
> > Hi Paul,
> > 
> > This is hopefully the final version of this trial branch.
> > 
> > Changes since v4:
> > 
> >     o Instead of generating CodeSamples/snippets.mk and calling it from
> >       main Makefile, generate CodeSamples/snippets.d which contains
> >       only dependencies and include it in the Makefile.
> > 
> > This change can fix the error you encountered in the previous version.
> > I'm just hoping...
> 
> Hmmmm...
> 
> 	$ make
> 	sh ./utilities/gen_snippet_d.sh
> 	CodeSamples/toolsoftrade/pcreate.c --> CodeSamples/toolsoftrade/pcreate@xxxxxxxxxxxx
> 
> But "make 2c" works.  This might be because I don't have the
> PERFBOOK_DEFAULT environment variable set?  Except that the Makefile code
> looks like this would have the default "make all" have the same effect as
> "make 2c".  Color me confused.
> 
> Anyway, yes, when I do "make 2c" it correctly reacts to moving labels
> around in CodeSamples/toolsoftrade/forkjoinvar.c, so that is good!
> 
> Here is the output of "make -v", in case that matters:
> 
> 	GNU Make 3.81
> 	Copyright (C) 2006  Free Software Foundation, Inc.
> 	This is free software; see the source for copying conditions.
> 	There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> 	PARTICULAR PURPOSE.
> 
> 	This program built for x86_64-pc-linux-gnu

And the diff below restores the behavior I would expect for "make",
even when modifying tags in CodeSamples/toolsoftrade/forkjoinvar.c,
though of course it might well break something else.  (And the diff
happens to include my test change to forkjoinvar.c.)

Thoughts?

							Thanx, Paul

------------------------------------------------------------------------

diff --git a/Makefile b/Makefile
index fe9f63f43e55..3e9e2c2ebf3c 100644
--- a/Makefile
+++ b/Makefile
@@ -85,13 +85,6 @@ endif
 SOURCES_OF_SNIPPET := $(shell grep -r -l -F '\begin{snippet}' CodeSamples)
 GEN_SNIPPET_D  = utilities/gen_snippet_d.pl utilities/gen_snippet_d.sh
 
-ifeq ($(MAKECMDGOALS),clean)
-else ifeq ($(MAKECMDGOALS),distclean)
-else ifeq ($(MAKECMDGOALS),neatfreak)
-else
--include CodeSamples/snippets.d
-endif
-
 default = $(PERFBOOK_DEFAULT)
 
 ifeq ($(default),)
@@ -103,6 +96,13 @@ endif
 .PHONY: all touchsvg clean distclean neatfreak 2c ls-unused $(ABBREVTARGETS) mslm perfbook-mslm.pdf mslmmsg help
 all: $(targ)
 
+ifeq ($(MAKECMDGOALS),clean)
+else ifeq ($(MAKECMDGOALS),distclean)
+else ifeq ($(MAKECMDGOALS),neatfreak)
+else
+-include CodeSamples/snippets.d
+endif
+
 2c: perfbook.pdf
 
 mslm: perfbook-mslm.pdf
diff --git a/CodeSamples/toolsoftrade/forkjoinvar.c b/CodeSamples/toolsoftrade/forkjoinvar.c
index 1580478fe2f9..642451d9e880 100644
--- a/CodeSamples/toolsoftrade/forkjoinvar.c
+++ b/CodeSamples/toolsoftrade/forkjoinvar.c
@@ -35,11 +35,11 @@ int main(int argc, char *argv[])
 	if (pid == 0) { /* child */
 		x = 1;					//\lnlbl{setx}
 		printf("Child process set x=1\n");	//\lnlbl{print:c}
-		exit(EXIT_SUCCESS);			//\lnlbl{exit:s}
+		exit(EXIT_SUCCESS);
 	}
 	if (pid < 0) { /* parent, upon error */
 		perror("fork");
-		exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);			//\lnlbl{exit:s}
 	}
 
 	/* parent */

--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux