Re: [PATCH 3/4] Makefile: factor common configuration in git-default-config.mak
Junio C Hamano writes: > I really think this is going in a wrong direction. Whatever you > happen to have chosen in this patch will be available to others, > while whatever are left out will not be. When adding new things, > people need to ask if it needs to be sharable or not, and the right > answer to that question will even change over time. My feeling is that Git's toplevel Makefile has become too large to remain completely monolithic, and splitting is good to organize it (and yes, splitting code into several files imply that future added code will have to be added in the right file, but that's not very different from splitting C code into several .c files to me). But that is another matter, and ... Junio C Hamano writes: > Then do something like > > all:: > $(MAKE) -C ../.. \ > PERL_SCRIPT=contrib/mw-to-git/git-remote-mediawiki.perl > \ > build-perl-script This ended up being very simple to implement (essentially, the Makefile already knows how to do this, so this just means adding convenience build-perl-script target to the toplevel), so 2 new patches follow doing this, with a ridiculously small new version of mw-to-git/Makefile. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] Makefile: factor common configuration in git-default-config.mak
Matthieu Moy writes: > Similarly to the extraction of perl-related code in perl.mak, we extract > general default configuration from the Makefile to make it available from > directories other than the toplevel. > > This is required to make perl.mak usable because it requires $(pathsep) > to be set. > > Signed-off-by: Matthieu Moy > --- I really think this is going in a wrong direction. Whatever you happen to have chosen in this patch will be available to others, while whatever are left out will not be. When adding new things, people need to ask if it needs to be sharable or not, and the right answer to that question will even change over time. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] Makefile: factor common configuration in git-default-config.mak
Similarly to the extraction of perl-related code in perl.mak, we extract general default configuration from the Makefile to make it available from directories other than the toplevel. This is required to make perl.mak usable because it requires $(pathsep) to be set. Signed-off-by: Matthieu Moy --- Makefile | 62 +- default-config.mak | 61 + 2 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 default-config.mak diff --git a/Makefile b/Makefile index f39d4a9..9649a41 100644 --- a/Makefile +++ b/Makefile @@ -346,67 +346,7 @@ GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN -include GIT-VERSION-FILE -# CFLAGS and LDFLAGS are for the users to override from the command line. - -CFLAGS = -g -O2 -Wall -LDFLAGS = -ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) -ALL_LDFLAGS = $(LDFLAGS) -STRIP ?= strip - -# Among the variables below, these: -# gitexecdir -# template_dir -# mandir -# infodir -# htmldir -# sysconfdir -# can be specified as a relative path some/where/else; -# this is interpreted as relative to $(prefix) and "git" at -# runtime figures out where they are based on the path to the executable. -# This can help installing the suite in a relocatable way. - -prefix = $(HOME) -bindir_relative = bin -bindir = $(prefix)/$(bindir_relative) -mandir = share/man -infodir = share/info -gitexecdir = libexec/git-core -mergetoolsdir = $(gitexecdir)/mergetools -sharedir = $(prefix)/share -gitwebdir = $(sharedir)/gitweb -localedir = $(sharedir)/locale -template_dir = share/git-core/templates -htmldir = share/doc/git-doc -ETC_GITCONFIG = $(sysconfdir)/gitconfig -ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes -lib = lib -# DESTDIR = -pathsep = : - -export prefix bindir sharedir sysconfdir gitwebdir localedir - -CC = cc -AR = ar -RM = rm -f -DIFF = diff -TAR = tar -FIND = find -INSTALL = install -RPMBUILD = rpmbuild -TCL_PATH = tclsh -TCLTK_PATH = wish -XGETTEXT = xgettext -MSGFMT = msgfmt -PTHREAD_LIBS = -lpthread -PTHREAD_CFLAGS = -GCOV = gcov - -export TCL_PATH TCLTK_PATH - -SPARSE_FLAGS = - - +include default-config.mak ### --- END CONFIGURATION SECTION --- diff --git a/default-config.mak b/default-config.mak new file mode 100644 index 000..b2aab3d --- /dev/null +++ b/default-config.mak @@ -0,0 +1,61 @@ +# CFLAGS and LDFLAGS are for the users to override from the command line. + +CFLAGS = -g -O2 -Wall +LDFLAGS = +ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) +ALL_LDFLAGS = $(LDFLAGS) +STRIP ?= strip + +# Among the variables below, these: +# gitexecdir +# template_dir +# mandir +# infodir +# htmldir +# sysconfdir +# can be specified as a relative path some/where/else; +# this is interpreted as relative to $(prefix) and "git" at +# runtime figures out where they are based on the path to the executable. +# This can help installing the suite in a relocatable way. + +prefix = $(HOME) +bindir_relative = bin +bindir = $(prefix)/$(bindir_relative) +mandir = share/man +infodir = share/info +gitexecdir = libexec/git-core +mergetoolsdir = $(gitexecdir)/mergetools +sharedir = $(prefix)/share +gitwebdir = $(sharedir)/gitweb +localedir = $(sharedir)/locale +template_dir = share/git-core/templates +htmldir = share/doc/git-doc +ETC_GITCONFIG = $(sysconfdir)/gitconfig +ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes +lib = lib +# DESTDIR = +pathsep = : + +export prefix bindir sharedir sysconfdir gitwebdir localedir + +CC = cc +AR = ar +RM = rm -f +DIFF = diff +TAR = tar +FIND = find +INSTALL = install +RPMBUILD = rpmbuild +TCL_PATH = tclsh +TCLTK_PATH = wish +XGETTEXT = xgettext +MSGFMT = msgfmt +PTHREAD_LIBS = -lpthread +PTHREAD_CFLAGS = +GCOV = gcov + +export TCL_PATH TCLTK_PATH + +SPARSE_FLAGS = + + -- 1.8.1.2.526.gf51a757 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html