{"thread":{"id":"38416","subject":"[PATCH v2] Makefile: collect some Makefile variables instead of directly assignment","startedAt":"2015-01-21T08:49:21Z","lastAt":"2015-01-21T09:33:43Z","messageCount":3,"participants":["Alexander Kuleshov","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"254978","messageId":"1421830161-27623-1-git-send-email-kuleshovmail@gmail.com","threadId":"38416","inReplyTo":null,"subject":"[PATCH v2] Makefile: collect some Makefile variables instead of directly assignment","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2015-01-21T08:49:21Z","receivedAt":"2015-01-21T08:49:21Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"Some of Makefile variables as TEST_PROGRAMS_NEED_X and BUILTIN_OBJS filled\ndirectly by hand, let's collect it with the standard functions of 'make' util.\n\nSigned-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>\n---\n Makefile | 134 +--------------------------------------------------------------\n 1 file changed, 2 insertions(+), 132 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b5b4cee..055db4b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -563,38 +563,7 @@ X =\n \n PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))\n \n-TEST_PROGRAMS_NEED_X += test-chmtime\n-TEST_PROGRAMS_NEED_X += test-ctype\n-TEST_PROGRAMS_NEED_X += test-config\n-TEST_PROGRAMS_NEED_X += test-date\n-TEST_PROGRAMS_NEED_X += test-delta\n-TEST_PROGRAMS_NEED_X += test-dump-cache-tree\n-TEST_PROGRAMS_NEED_X += test-dump-split-index\n-TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n-TEST_PROGRAMS_NEED_X += test-genrandom\n-TEST_PROGRAMS_NEED_X += test-hashmap\n-TEST_PROGRAMS_NEED_X += test-index-version\n-TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-match-trees\n-TEST_PROGRAMS_NEED_X += test-mergesort\n-TEST_PROGRAMS_NEED_X += test-mktemp\n-TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-path-utils\n-TEST_PROGRAMS_NEED_X += test-prio-queue\n-TEST_PROGRAMS_NEED_X += test-read-cache\n-TEST_PROGRAMS_NEED_X += test-regex\n-TEST_PROGRAMS_NEED_X += test-revision-walking\n-TEST_PROGRAMS_NEED_X += test-run-command\n-TEST_PROGRAMS_NEED_X += test-scrap-cache-tree\n-TEST_PROGRAMS_NEED_X += test-sha1\n-TEST_PROGRAMS_NEED_X += test-sha1-array\n-TEST_PROGRAMS_NEED_X += test-sigchain\n-TEST_PROGRAMS_NEED_X += test-string-list\n-TEST_PROGRAMS_NEED_X += test-submodule-config\n-TEST_PROGRAMS_NEED_X += test-subprocess\n-TEST_PROGRAMS_NEED_X += test-svn-fe\n-TEST_PROGRAMS_NEED_X += test-urlmatch-normalization\n-TEST_PROGRAMS_NEED_X += test-wildmatch\n+TEST_PROGRAMS_NEED_X = $(patsubst %.c,%, $(wildcard test-*.c))\n \n TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))\n \n@@ -811,105 +780,7 @@ LIB_OBJS += wt-status.o\n LIB_OBJS += xdiff-interface.o\n LIB_OBJS += zlib.o\n \n-BUILTIN_OBJS += builtin/add.o\n-BUILTIN_OBJS += builtin/annotate.o\n-BUILTIN_OBJS += builtin/apply.o\n-BUILTIN_OBJS += builtin/archive.o\n-BUILTIN_OBJS += builtin/bisect--helper.o\n-BUILTIN_OBJS += builtin/blame.o\n-BUILTIN_OBJS += builtin/branch.o\n-BUILTIN_OBJS += builtin/bundle.o\n-BUILTIN_OBJS += builtin/cat-file.o\n-BUILTIN_OBJS += builtin/check-attr.o\n-BUILTIN_OBJS += builtin/check-ignore.o\n-BUILTIN_OBJS += builtin/check-mailmap.o\n-BUILTIN_OBJS += builtin/check-ref-format.o\n-BUILTIN_OBJS += builtin/checkout-index.o\n-BUILTIN_OBJS += builtin/checkout.o\n-BUILTIN_OBJS += builtin/clean.o\n-BUILTIN_OBJS += builtin/clone.o\n-BUILTIN_OBJS += builtin/column.o\n-BUILTIN_OBJS += builtin/commit-tree.o\n-BUILTIN_OBJS += builtin/commit.o\n-BUILTIN_OBJS += builtin/config.o\n-BUILTIN_OBJS += builtin/count-objects.o\n-BUILTIN_OBJS += builtin/credential.o\n-BUILTIN_OBJS += builtin/describe.o\n-BUILTIN_OBJS += builtin/diff-files.o\n-BUILTIN_OBJS += builtin/diff-index.o\n-BUILTIN_OBJS += builtin/diff-tree.o\n-BUILTIN_OBJS += builtin/diff.o\n-BUILTIN_OBJS += builtin/fast-export.o\n-BUILTIN_OBJS += builtin/fetch-pack.o\n-BUILTIN_OBJS += builtin/fetch.o\n-BUILTIN_OBJS += builtin/fmt-merge-msg.o\n-BUILTIN_OBJS += builtin/for-each-ref.o\n-BUILTIN_OBJS += builtin/fsck.o\n-BUILTIN_OBJS += builtin/gc.o\n-BUILTIN_OBJS += builtin/get-tar-commit-id.o\n-BUILTIN_OBJS += builtin/grep.o\n-BUILTIN_OBJS += builtin/hash-object.o\n-BUILTIN_OBJS += builtin/help.o\n-BUILTIN_OBJS += builtin/index-pack.o\n-BUILTIN_OBJS += builtin/init-db.o\n-BUILTIN_OBJS += builtin/interpret-trailers.o\n-BUILTIN_OBJS += builtin/log.o\n-BUILTIN_OBJS += builtin/ls-files.o\n-BUILTIN_OBJS += builtin/ls-remote.o\n-BUILTIN_OBJS += builtin/ls-tree.o\n-BUILTIN_OBJS += builtin/mailinfo.o\n-BUILTIN_OBJS += builtin/mailsplit.o\n-BUILTIN_OBJS += builtin/merge.o\n-BUILTIN_OBJS += builtin/merge-base.o\n-BUILTIN_OBJS += builtin/merge-file.o\n-BUILTIN_OBJS += builtin/merge-index.o\n-BUILTIN_OBJS += builtin/merge-ours.o\n-BUILTIN_OBJS += builtin/merge-recursive.o\n-BUILTIN_OBJS += builtin/merge-tree.o\n-BUILTIN_OBJS += builtin/mktag.o\n-BUILTIN_OBJS += builtin/mktree.o\n-BUILTIN_OBJS += builtin/mv.o\n-BUILTIN_OBJS += builtin/name-rev.o\n-BUILTIN_OBJS += builtin/notes.o\n-BUILTIN_OBJS += builtin/pack-objects.o\n-BUILTIN_OBJS += builtin/pack-redundant.o\n-BUILTIN_OBJS += builtin/pack-refs.o\n-BUILTIN_OBJS += builtin/patch-id.o\n-BUILTIN_OBJS += builtin/prune-packed.o\n-BUILTIN_OBJS += builtin/prune.o\n-BUILTIN_OBJS += builtin/push.o\n-BUILTIN_OBJS += builtin/read-tree.o\n-BUILTIN_OBJS += builtin/receive-pack.o\n-BUILTIN_OBJS += builtin/reflog.o\n-BUILTIN_OBJS += builtin/remote.o\n-BUILTIN_OBJS += builtin/remote-ext.o\n-BUILTIN_OBJS += builtin/remote-fd.o\n-BUILTIN_OBJS += builtin/repack.o\n-BUILTIN_OBJS += builtin/replace.o\n-BUILTIN_OBJS += builtin/rerere.o\n-BUILTIN_OBJS += builtin/reset.o\n-BUILTIN_OBJS += builtin/rev-list.o\n-BUILTIN_OBJS += builtin/rev-parse.o\n-BUILTIN_OBJS += builtin/revert.o\n-BUILTIN_OBJS += builtin/rm.o\n-BUILTIN_OBJS += builtin/send-pack.o\n-BUILTIN_OBJS += builtin/shortlog.o\n-BUILTIN_OBJS += builtin/show-branch.o\n-BUILTIN_OBJS += builtin/show-ref.o\n-BUILTIN_OBJS += builtin/stripspace.o\n-BUILTIN_OBJS += builtin/symbolic-ref.o\n-BUILTIN_OBJS += builtin/tag.o\n-BUILTIN_OBJS += builtin/unpack-file.o\n-BUILTIN_OBJS += builtin/unpack-objects.o\n-BUILTIN_OBJS += builtin/update-index.o\n-BUILTIN_OBJS += builtin/update-ref.o\n-BUILTIN_OBJS += builtin/update-server-info.o\n-BUILTIN_OBJS += builtin/upload-archive.o\n-BUILTIN_OBJS += builtin/var.o\n-BUILTIN_OBJS += builtin/verify-commit.o\n-BUILTIN_OBJS += builtin/verify-pack.o\n-BUILTIN_OBJS += builtin/verify-tag.o\n-BUILTIN_OBJS += builtin/write-tree.o\n+BUILTIN_OBJS = $(patsubst %.c,%.o, $(wildcard builtin/*.c))\n \n GITLIBS = $(LIB_FILE) $(XDIFF_LIB)\n EXTLIBS =\n@@ -2520,4 +2391,3 @@ cover_db: coverage-report\n \n cover_db_html: cover_db\n \tcover -report html -outputdir cover_db_html cover_db\n-\n-- \n2.3.0-rc1\n"},{"id":"254988","messageId":"xmqqzj9cwkq4.fsf@gitster.dls.corp.google.com","threadId":"38416","inReplyTo":"1421830161-27623-1-git-send-email-kuleshovmail@gmail.com","subject":"Re: [PATCH v2] Makefile: collect some Makefile variables instead of directly assignment","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-21T09:23:31Z","receivedAt":"2015-01-21T09:23:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n\n> Some of Makefile variables as TEST_PROGRAMS_NEED_X and BUILTIN_OBJS filled\n> directly by hand, let's collect it with the standard functions of 'make' util.\n\nI am not sure if we want to do this.\n\n$(wildcard) is a double-edged sword.  It will grab any file that\nmatches on the filesystem, not just the ones we want to include in\nthe Git source set.  I often have a file called test-something and\nI'd prefer not to see such a random thing included in the build,\nonly because the filename matches some pattern.\n\nWhile \"we consider anything with a name that match the pattern we\nsay matter (e.g. test-*.c or builtin/*.c) as part of the source set\"\nis sometimes handy (it allows us to be lazy), it risks surprising\nunsuspecting users.\n\nSo I dunno.\n"},{"id":"254989","messageId":"CANCZXo6DaSB4eiqQ6XrDpYMYeES50t1pi8CJwdzPZ2DOQpRjig@mail.gmail.com","threadId":"38416","inReplyTo":"xmqqzj9cwkq4.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] Makefile: collect some Makefile variables instead of directly assignment","fromName":"Alexander Kuleshov","fromEmail":"kuleshovmail@gmail.com","sentAt":"2015-01-21T09:33:43Z","receivedAt":"2015-01-21T09:33:43Z","isPatch":true,"sender":{"key":"kuleshovmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2699235?v=4"},"body":"Hello Junio,\n\n2015-01-21 15:23 GMT+06:00 Junio C Hamano <gitster@pobox.com>:\n> Alexander Kuleshov <kuleshovmail@gmail.com> writes:\n>\n>> Some of Makefile variables as TEST_PROGRAMS_NEED_X and BUILTIN_OBJS filled\n>> directly by hand, let's collect it with the standard functions of 'make' util.\n>\n> I am not sure if we want to do this.\n>\n> $(wildcard) is a double-edged sword.  It will grab any file that\n> matches on the filesystem, not just the ones we want to include in\n> the Git source set.  I often have a file called test-something and\n> I'd prefer not to see such a random thing included in the build,\n> only because the filename matches some pattern.\n\nYes, grabbing files by test-*.c is unreliable in this case. But what\nabout builtin/*.c?\nIs there any plans that builtin will contain something another than\nbuiltin object files?\n\n>\n> While \"we consider anything with a name that match the pattern we\n> say matter (e.g. test-*.c or builtin/*.c) as part of the source set\"\n> is sometimes handy (it allows us to be lazy), it risks surprising\n> unsuspecting users.\n>\n> So I dunno.\n"}]}