Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Khem Raj <raj.khem@gmail.com>, Fabio Estevam <festevam@denx.de>
Cc: openembeded-devel <openembedded-devel@lists.openembedded.org>,
	"Otavio Salvador" <otavio.salvador@ossystems.com.br>,
	Heiko Schocher <hs@denx.de>,
	Alexandre BELLONI <alexandre.belloni@bootlin.com>
Subject: RE: [oe] [PATCH v2 meta-oe] rtc-tools: Add a recipe
Date: Thu, 27 Jan 2022 21:01:31 +0000	[thread overview]
Message-ID: <2ae1517616ed4e068c46833e812d3e1e@axis.com> (raw)
In-Reply-To: <CAMKF1spmTzkh_egyGhyXgkfBag_eHMDZCHoaTQSPHpemo=MYbw@mail.gmail.com>

> -----Original Message-----
> From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of Khem Raj
> Sent: den 26 januari 2022 19:33
> To: Fabio Estevam <festevam@denx.de>
> Cc: openembeded-devel <openembedded-devel@lists.openembedded.org>; Otavio Salvador <otavio.salvador@ossystems.com.br>; Heiko Schocher <hs@denx.de>; Alexandre BELLONI <alexandre.belloni@bootlin.com>
> Subject: Re: [oe] [PATCH v2 meta-oe] rtc-tools: Add a recipe
> 
> On Wed, Jan 26, 2022 at 10:22 AM Fabio Estevam <festevam@denx.de> wrote:
> >
> > rtc-tools is a useful utility developed by Alexandre Belloni
> > for testing RTC kernel drivers, such as y2038 support.
> >
> > Based on the initial recipe from Heiko Schocher <hs@denx.de>.
> >
> > Signed-off-by: Fabio Estevam <festevam@denx.de>
> > ---
> > Changes since v1:
> > - None: just sent it to oe-devel as suggested by Khem.
> >
> >  .../0001-rtc-tools-Add-a-Makefile.patch       | 52 +++++++++++++++++++
> >  .../rtc-tools/rtc-tools_1.0.0.bb              | 19 +++++++
> >  2 files changed, 71 insertions(+)
> >  create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch
> >  create mode 100644 meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb
> >
> > diff --git a/meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch b/meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch
> > new file mode 100644
> > index 000000000000..a372e390efb9
> > --- /dev/null
> > +++ b/meta-oe/recipes-support/rtc-tools/rtc-tools/0001-rtc-tools-Add-a-Makefile.patch
> > @@ -0,0 +1,52 @@
> > +From faa6dd2e4d063afcaa19f16740a3fc413a399e60 Mon Sep 17 00:00:00 2001
> > +From: Fabio Estevam <festevam@denx.de>
> > +Date: Sun, 23 Jan 2022 09:22:19 -0300
> > +Subject: [PATCH rtc-tools] rtc-tools: Add a Makefile
> > +
> > +Add a Makefile to make installation and uninstallation
> > +process easier.
> > +
> > +Upstream-Status: Submitted [https://marc.info/?l=linux-rtc&m=164294073129803&w=2]
> > +Signed-off-by: Fabio Estevam <festevam@denx.de>
> > +---
> > + Makefile | 29 +++++++++++++++++++++++++++++
> > + 1 file changed, 29 insertions(+)
> > + create mode 100644 Makefile
> > +
> > +diff --git a/Makefile b/Makefile
> > +new file mode 100644
> > +index 000000000000..4f244d9289f1
> > +--- /dev/null
> > ++++ b/Makefile
> > +@@ -0,0 +1,29 @@
> > ++prefix ?= /usr
> > ++bindir ?= $(prefix)/bin
> > ++
> > ++EXEC = rtc-range rtc rtc-sync
> > ++
> > ++all: $(EXEC)
> > ++
> > ++rtc-range: rtc-range.c
> > ++      $(CC) $(CFLAGS) -o $@ rtc-range.c
> 
> perhaps you should also be using LDFLAGS here.
> 
> > ++
> > ++rtc: rtc.c
> > ++      $(CC) $(CFLAGS) -o $@ rtc.c
> 
> here
> 
> > ++
> > ++rtc-sync: rtc-sync.c
> > ++      $(CC) $(CFLAGS) -o $@ rtc-sync.c
> > ++
> 
> and here

Actually, it is better to just remove the three rules above. 
Make has a built in rule to build a binary from a C source file.

> > ++clean:
> > ++      rm -f $(EXEC)

Change to:

clean:
	$(RM) $(EXEC)

> > ++
> > ++install: rtc-range rtc rtc-sync
> > ++      mkdir -p '$(DESTDIR)$(bindir)'
> > ++      install -m755 rtc-range '$(DESTDIR)$(bindir)/rtc-range'
> > ++      install -m755 rtc '$(DESTDIR)$(bindir)/rtc'
> > ++      install -m755 rtc-sync '$(DESTDIR)$(bindir)/rtc-sync'

Change to:

install:
	install -d $(DESTDIR)$(bindir)
	install $(EXEC) $(DESTDIR)$(bindir)

The install target should not have any dependencies or it might 
build them in pseudo context.

> > ++
> > ++uninstall:
> > ++      rm -rf '$(DESTDIR)$(bindir)/rtc-range'
> > ++      rm -rf '$(DESTDIR)$(bindir)/rtc'
> > ++      rm -rf '$(DESTDIR)$(bindir)/rtc-sync'

Change to:

uninstall:
	$(RM) -r $(addprefix $(DESTDIR)$(bindir),$(EXEC))

> > +--
> > +2.25.1
> > diff --git a/meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb b/meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb
> > new file mode 100644
> > index 000000000000..8f0326829d8c
> > --- /dev/null
> > +++ b/meta-oe/recipes-support/rtc-tools/rtc-tools_1.0.0.bb
> > @@ -0,0 +1,19 @@
> > +DESCRIPTION = "Useful programs to test rtc drivers"

Change "DESCRIPTION" to "SUMMARY".

> > +LICENSE = "GPLv2"

Change "GPLv2" to "GPL-2.0-only".

> > +LIC_FILES_CHKSUM = "file://COPYING;md5=74274e8a218423e49eefdea80bc55038"
> > +
> > +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/rtc-tools.git;protocol=https;branch=master \

Change "rtc-tools" to "${BPN}".

> > +           file://0001-rtc-tools-Add-a-Makefile.patch \
> > +           "
> > +SRCREV ?= "acc442e7af4e1e783432a43d37f1a7938c692659"

Change "?=" to "=".

> > +
> > +S = "${WORKDIR}/git"
> > +
> > +TARGET_CC_ARCH += "${LDFLAGS}"
> 
> this may not be needed if above changes are made.

Correct. Remove it.

> > +EXTRA_OEMAKE = " \
> > +       DESTDIR=${D} \
> 
> DESTDIR=${D} should perhaps already be part of oe_runmake

No, it isn't by default.

> 
> > +       all \

Remove "all", and rewrite this as:

EXTRA_OEMAKE = "DESTDIR=${D}"

> > +       "
> > +do_install() {
> > +       oe_runmake install
> > +}
> > --
> > 2.25.1

//Peter


      parent reply	other threads:[~2022-01-27 21:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220126182232.1790127-1-festevam@denx.de>
2022-01-26 18:32 ` [PATCH v2 meta-oe] rtc-tools: Add a recipe Khem Raj
2022-01-26 19:00   ` Otavio Salvador
2022-01-27 21:04     ` [oe] " Peter Kjellerstedt
2022-01-27 21:01   ` Peter Kjellerstedt [this message]

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=2ae1517616ed4e068c46833e812d3e1e@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=festevam@denx.de \
    --cc=hs@denx.de \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=otavio.salvador@ossystems.com.br \
    --cc=raj.khem@gmail.com \
    /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