public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/3] build system: Add explicit make rules
Date: Wed, 5 Aug 2020 11:27:03 +0200	[thread overview]
Message-ID: <20200805092703.GB5522@yuki.lan> (raw)
In-Reply-To: <550701550.5736445.1596440755258.JavaMail.zimbra@redhat.com>

Hi!
> > This commit adds explicit build rules, the main motivation are recent
> > build failures caused by library orderings. To fix that this commit
> > introduces LTPLDLIBS special variable that is passed to linker before
> > the LDLIBS which avoids the need for tricks as
> > "LDLIBS := -lltpfoo $(LDLIBS)" in the Makefiles.
> > 
> > This commit also silences the output by default a bit, the verbose
> > output could be enabled by VERBOSE=1 env variable, which is probably
> > what most of the build systems will do if this gets commited. I guess
> > that we can as well silence a bit the "make entering/leaving directory"
> > if this the right way to go.
> 
> alias for V=0 / V=1 would be nice

Done in a follow up patch.

> LTPLDLIBS should probably be mentioned in doc/build-system-guide.txt

I've added a line to the variables listing in there before pushing.

> > 
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > ---
> >  include/mk/env_post.mk |  2 ++
> >  include/mk/rules.mk    | 29 +++++++++++++++++++++++++++++
> >  2 files changed, 31 insertions(+)
> >  create mode 100644 include/mk/rules.mk
> > 
> > diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
> > index f4169ad66..bdf8c696d 100644
> > --- a/include/mk/env_post.mk
> > +++ b/include/mk/env_post.mk
> > @@ -107,4 +107,6 @@ $(error You must define $$(prefix) before executing
> > install)
> >  endif # END $(filter-out install,$(MAKECMDGOALS)),$(MAKECMDGOALS)
> >  endif
> >  
> > +include $(top_srcdir)/include/mk/rules.mk
> > +
> >  endif
> > diff --git a/include/mk/rules.mk b/include/mk/rules.mk
> > new file mode 100644
> > index 000000000..e9b9c35ef
> > --- /dev/null
> > +++ b/include/mk/rules.mk
> > @@ -0,0 +1,29 @@
> > +%.o: %.c
> > +ifdef VERBOSE
> > +	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
> > +else
> > +	@$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
> > +	@echo CC $@
> > +endif
> 
> What if we wouldn't print "DIR" (for non-clean targets) and printed relative paths instead?

Great idea, I've added these changes to the first patch in the series
before I pushed it.

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2020-08-05  9:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 12:15 [LTP] [PATCH 0/3] Build system fixes Cyril Hrubis
2020-07-31 12:15 ` [LTP] [PATCH 1/3] build system: Add explicit make rules Cyril Hrubis
2020-08-03  7:47   ` Jan Stancek
2020-08-03  7:59     ` Li Wang
2020-08-03 13:27     ` Petr Vorel
2020-08-05  9:27     ` Cyril Hrubis [this message]
2020-08-05 10:31       ` Li Wang
2020-08-05 10:40         ` Cyril Hrubis
2020-07-31 12:15 ` [LTP] [PATCH 2/3] testcases: Make use of LTPLDLIBS Cyril Hrubis
2020-07-31 12:15 ` [LTP] [PATCH 3/3] build system: Silence the output a bit more Cyril Hrubis
2020-08-03  7:52   ` Li Wang
2020-07-31 13:02 ` [LTP] [PATCH 0/3] Build system fixes Petr Vorel

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=20200805092703.GB5522@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox