Re: [PATCH 1/4] Makefile: move "Platform specific tweaks" above LIB_{H,OBJS}

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

 



On Sun, Nov 14, 2010 at 18:23, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Ãvar ArnfjÃrà Bjarmason wrote:
>
>> Change the Makefile so that the "Platform specific tweaks" section
>> comes before the assignments to LIB_H and LIB_OBJS.
>
> Currently the Makefile is structured like this:
>
> Â Â Â ÂA. default target
> Â Â Â ÂB. basics
> Â Â Â Â Â 1. basic configuration section
> Â Â Â Â Â Â Âa. -include GIT-VERSION-FILE and recipe to generate it
> Â Â Â Â Â Â Âb. uname_S := $(shell uname -s) and similar variables
> Â Â Â Â Â Â Âc. user-facing compilation variables: CFLAGS, LDFLAGS, STRIP
> Â Â Â Â Â Â Âd. user-facing paths: prefix, bindir_relative, etc
> Â Â Â Â Â Â Âe. program names: CC, AR, etc
> Â Â Â Â Â 2. basic cflags and ldflags (almost configurable)
> Â Â Â Â Â 3. main list of program targets:
> Â Â Â Â Â Â ÂSCRIPTS, PROGRAMS, TEST_PROGRAMS, BUILT_INS,
> Â Â Â Â Â Â ÂOTHER_PROGRAMS, BINDIR_PROGRAMS
> Â Â Â Â Â 4. defaults for SHELL_PATH, PERL_PATH, PYTHON_PATH
> Â Â Â Â Â 5. main list of library targets:
> Â Â Â Â Â Â ÂLIB_FILE, XDIFF_LIB, LIB_H, LIB_OBJS, BUILTIN_OBJS
> Â Â Â Â Â 6. GITLIBS, EXTLIBS for the linker command line
> Â Â Â Â Â 7. platform-specific tweaks
> Â Â Â Â Â 8. -include config.mak, config.mak.autogen
> Â Â Â ÂC. preparations
> Â Â Â Â Â 1. handling of the various NO_THIS_OR_THAT options.
> Â Â Â Â Â Â ÂThis affects BASIC_CFLAGS, COMPAT_CFLAGS,
> Â Â Â Â Â Â ÂCOMPAT_OBJS, PROGRAMS, EXTLIBS, LIB_OBJ, LIB_H, etc
> Â Â Â Â Â 2. machinery for non-noisy build
> Â Â Â Â Â 3. shell-quoted and C-quoted variables
> Â Â Â Â Â 4. ALL_CFLAGS, ALL_LDFLAGS
> Â Â Â ÂD. main build rules
> Â Â Â Â Â 1. all:: targets for the main build, subdirs
> Â Â Â Â Â 2. shell sanity check
> Â Â Â Â Â 3. building the git binary and built-ins
> Â Â Â Â Â 4. scripts and gitweb
> Â Â Â Â Â 5. autoconf
> Â Â Â Â Â 6. building objects:
> Â Â Â Â Â Â Âa. %.o: %.c rule, header deps, dependency checking
> Â Â Â Â Â Â Âb. target-specific -D flags
> Â Â Â Â Â 7. building non-builtins, remote-curl
> Â Â Â Â Â 8. libs
> Â Â Â Â Â 9. subdirs
> Â Â Â ÂE. GIT-CFLAGS, GIT-BUILD-OPTIONS, GIT-GUI-VARS
> Â Â Â ÂF. bin-wrappers
> Â Â Â ÂG. tests
> Â Â Â ÂH. installation rules
> Â Â Â ÂI. maintainer's dist rules, check-doc, coverage, etc

That listing should be in a comment at the start of the
Makefile. Please submit a patch for that!

> This patch proposes moving A5 (main list of library targets) after
> A8 (end of configuration).

Right. Thanks for the helpful outline.

>> In the ab/i18n series I only want to build gettext.o (by adding it to
>> LIB_OBJS) if NO_GETTEXT is unset. It's not possible to do that without
>> an ugly hack if we haven't applied our platform specific tweaks before
>> LIB_{H,OBJS} gets assigned to.
>>
>> See <201008140002.40587.j6t@xxxxxxxx> (subject: "[PATCH] Do not build
>> i18n on Windows.") for Johannes's original report, and my follow-up in
>> <AANLkTiku5R+idX-C8f0AcCikBLmfEb5ZEhdft+CSRzU0@xxxxxxxxxxxxxx> where I
>> suggested that the problem be solved in the manner of this patch.
>
> This doesn't motivate the patch all all to me. ÂIs changing the list
> of LIB_OBJS in section C1 really an ugly hack? ÂIt is where
> configuration-specific things go and how BLK_SHA1, PROGRAM_OBJS, etc
> work already.

Yeah, because if it hadn't come before A8 it would have been *not*
assigned to in the first place like we do everywhere else. Moving A8
before A5 enables us to do that.

> That said, I can see another reason to move A3 and A5 lower down in
> the makefile. ÂNamely, they don't seem to have anything obvious to
> do with configuration. ÂIncluding the basic list of objects that
> high up may make the makefile easier to read straight through, but
> I don't think anyone is reading it straight through.
>
> So I wouldn't have anything against moving both A3 and A5 to right
> before C1, I just think it needs different motivation.

I was thinking about moving A3 & A5 further down. But since I just
needed A5 now I only ended up doing that. Moving them both would clean
things up though. I think we should do A8 as early as possible.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]