Re: [protocol] Add spice/Makefile to the generated .gitignore

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

 



> Hi,
> 
> I think you want to search for Makefile(s) in the build directory
> not the source directory.
> I guess the build directory would be the current directory for this Makefile.
> Is  MAINTAINERCLEANFILES the approrpriate place for Makefiles?
> Makefiles are removed by 'distclean' or 'maintainer-clean' targets.

I think this is, sadly, more tangled than first meets the eye.

That is, I share your instincts, but pressing further it appears messy.

First of all, the stock git.mk (which we have taken, essentially unmodified
from the https://github.com/behdad/git.mk), is *supposed* to
add Makefile and Makefile.in to the .gitignore file.

For reasons I can't puzzle out of the code, Shaun (the git.mk author) felt that all paths needed
to be prefixed with a '/' in the .gitignore.  This has the effect of making spice/.gitignore
contain '/Makefile' (and /Makefile.in), which does not work.

To overcome this for Makefile.in, Marc-André added the 'find' hack to Makefile.am.  Thus, when I
got sick and tired of git status always telling me that spice-common was dirty, I
chose to extend the hack by adding Makefile to it; hence my patch.

If you believe that git.mk is broken, then the attached patch 'fixes' it.  This
presumes that Shaun used the preceeding / as an anchor, rather than just
using a '^' to anchor the expression, and there is no other rational.

I will email Shaun this patch to see if it is an easy oversight, or if there
is more than I have not understood, and to see if he can come up with a way to fix it for us.

Cheers,

Jeremy
diff --git a/Makefile.am b/Makefile.am
index d2e49a4..15e7c0b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,6 @@ MAINTAINERCLEANFILES =						\
 	$(srcdir)/ltmain.sh					\
 	$(srcdir)/missing					\
 	$(srcdir)/mkinstalldirs					\
-	`find "$(srcdir)" -type f -name Makefile.in -print`	\
 	$(NULL)
 
 -include $(top_srcdir)/git.mk
diff --git a/git.mk b/git.mk
index 8aebb8d..56ff6ad 100644
--- a/git.mk
+++ b/git.mk
@@ -94,7 +94,7 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
 				tmpl/$(DOC_MODULE)-unused.sgml \
 				"tmpl/*.bak" \
 				xml html \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
 			for x in \
@@ -108,20 +108,20 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
 				$(DOC_H_FILE) \
 				"*/.xml2po.mo" \
 				"*/*.omf.out" \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \
 			for x in \
 				$(_HELP_LC_FILES) \
 				$(_HELP_LC_STAMPS) \
 				$(_HELP_MOFILES) \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test "x$(gsettings_SCHEMAS)" = x; then :; else \
 			for x in \
 				$(gsettings_SCHEMAS:.xml=.valid) \
 				$(gsettings__enum_file) \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test -f $(srcdir)/po/Makefile.in.in; then \
 			for x in \
@@ -137,7 +137,7 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
 				intltool-extract.in \
 				intltool-merge.in \
 				intltool-update.in \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test -f $(srcdir)/configure; then \
 			for x in \
@@ -147,13 +147,13 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
 				stamp-h1 \
 				libtool \
 				config.lt \
-			; do echo /$$x; done; \
+			; do echo $$x; done; \
 		fi; \
 		if test "x$(DEJATOOL)" = x; then :; else \
 			for x in \
 				$(DEJATOOL) \
-			; do echo /$$x.sum; echo /$$x.log; done; \
-			echo /site.exp; \
+			; do echo $$x.sum; echo $$x.log; done; \
+			echo site.exp; \
 		fi; \
 		for x in \
 			.gitignore \
@@ -184,10 +184,10 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
 			"*~" \
 			".*.sw[nop]" \
 			".dirstamp" \
-		; do echo /$$x; done; \
+		; do echo $$x; done; \
 	} | \
 	sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
-	sed 's@/[.]/@/@g' | \
+	sed 's@^\./@@g' | \
 	LC_ALL=C sort | uniq > $@.tmp && \
 	mv $@.tmp $@;
 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]