From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: opensbi@lists.infradead.org
Subject: [PATCH v2] Makefile: Pass relative paths to the compiler.
Date: Mon, 29 Nov 2021 10:13:25 -0800 [thread overview]
Message-ID: <87tufu3k56.fsf@ponder> (raw)
In-Reply-To: <87a6hnp7vv.fsf@igel.home>
On 2021-11-29, Andreas Schwab wrote:
> On Nov 28 2021, Vagrant Cascadian wrote:
>
>> diff --git a/Makefile b/Makefile
>> index 8623c1c..d017534 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -361,7 +361,7 @@ compile_cc_dep = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
>> -MM $(2) >> $(1) || rm -f $(1)
>> compile_cc = $(CMD_PREFIX)mkdir -p `dirname $(1)`; \
>> echo " CC $(subst $(build_dir)/,,$(1))"; \
>> - $(CC) $(CFLAGS) $(call dynamic_flags,$(1),$(2)) -c $(2) -o $(1)
>> + $(CC) $(CFLAGS) $(call dynamic_flags,$(1),$(2)) -c $(subst $(src_dir)/,,$(2)) -o $(1)
>
> How about making src_dir empty throughout? This now depends on
> $(src_dir) being identical to ".", so making that explicit would be
> better.
Is this more-or-less what you were suggesting?
diff --git a/Makefile b/Makefile
index 8623c1c..cd4be3c 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ READLINK ?= readlink
endif
# Find out source, build, and install directories
-src_dir=$(CURDIR)
+src_dir=.
ifdef O
build_dir=$(shell $(READLINK) -f $(O))
else
It builds fine (haven't boot tested), and doesn't embed the build path
in the binaries.
live well,
vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/opensbi/attachments/20211129/56b04f77/attachment-0001.sig>
next prev parent reply other threads:[~2021-11-29 18:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 1:55 [PATCH v2] Makefile: Pass relative paths to the compiler Vagrant Cascadian
2021-11-29 3:05 ` Dong Du
2021-11-29 3:58 ` Xiang W
2021-11-29 10:35 ` Andreas Schwab
2021-11-29 18:13 ` Vagrant Cascadian [this message]
2021-12-02 3:46 ` Anup Patel
2021-12-03 20:43 ` Vagrant Cascadian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tufu3k56.fsf@ponder \
--to=vagrant@reproducible-builds.org \
--cc=opensbi@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.