All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 meta-oe] rtc-tools: Add a recipe
       [not found] <20220126182232.1790127-1-festevam@denx.de>
@ 2022-01-26 18:32 ` Khem Raj
  2022-01-26 19:00   ` Otavio Salvador
  2022-01-27 21:01   ` Peter Kjellerstedt
  0 siblings, 2 replies; 4+ messages in thread
From: Khem Raj @ 2022-01-26 18:32 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: openembeded-devel, Otavio Salvador, Heiko Schocher, Alexandre BELLONI

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

> ++clean:
> ++      rm -f $(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'
> ++
> ++uninstall:
> ++      rm -rf '$(DESTDIR)$(bindir)/rtc-range'
> ++      rm -rf '$(DESTDIR)$(bindir)/rtc'
> ++      rm -rf '$(DESTDIR)$(bindir)/rtc-sync'
> +--
> +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"
> +LICENSE = "GPLv2"
> +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 \
> +           file://0001-rtc-tools-Add-a-Makefile.patch \
> +           "
> +SRCREV ?= "acc442e7af4e1e783432a43d37f1a7938c692659"
> +
> +S = "${WORKDIR}/git"
> +
> +TARGET_CC_ARCH += "${LDFLAGS}"

this may not be needed if above changes are made.

> +EXTRA_OEMAKE = " \
> +       DESTDIR=${D} \

DESTDIR=${D} should perhaps already be part of oe_runmake

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 meta-oe] rtc-tools: Add a recipe
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Otavio Salvador @ 2022-01-26 19:00 UTC (permalink / raw)
  To: Khem Raj
  Cc: Fabio Estevam, openembeded-devel, Heiko Schocher, Alexandre BELLONI

Em qua., 26 de jan. de 2022 às 15:32, Khem Raj <raj.khem@gmail.com> escreveu:
> > +do_install() {
> > +       oe_runmake install
> > +}

IIRC this is the default so EXTRA_OEMAKE (removing this task) would just work.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [oe] [PATCH v2 meta-oe] rtc-tools: Add a recipe
  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:01   ` Peter Kjellerstedt
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2022-01-27 21:01 UTC (permalink / raw)
  To: Khem Raj, Fabio Estevam
  Cc: openembeded-devel, Otavio Salvador, Heiko Schocher, Alexandre BELLONI

> -----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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [oe] [PATCH v2 meta-oe] rtc-tools: Add a recipe
  2022-01-26 19:00   ` Otavio Salvador
@ 2022-01-27 21:04     ` Peter Kjellerstedt
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2022-01-27 21:04 UTC (permalink / raw)
  To: Otavio Salvador, Khem Raj
  Cc: Fabio Estevam, openembeded-devel, Heiko Schocher, Alexandre BELLONI

> -----Original Message-----
> From: openembedded-devel@lists.openembedded.org <openembedded-
> devel@lists.openembedded.org> On Behalf Of Otavio Salvador
> Sent: den 26 januari 2022 20:01
> To: Khem Raj <raj.khem@gmail.com>
> Cc: Fabio Estevam <festevam@denx.de>; openembeded-devel <openembedded-
> devel@lists.openembedded.org>; Heiko Schocher <hs@denx.de>; Alexandre
> BELLONI <alexandre.belloni@bootlin.com>
> Subject: Re: [oe] [PATCH v2 meta-oe] rtc-tools: Add a recipe
> 
> Em qua., 26 de jan. de 2022 às 15:32, Khem Raj <raj.khem@gmail.com>
> escreveu:
> > > +do_install() {
> > > +       oe_runmake install
> > > +}
> 
> IIRC this is the default so EXTRA_OEMAKE (removing this task) would just
> work.

No. There is a default base_do_compile() in base.bbclass that runs 
oe_runmake if a Makefile exists, but the default base_do_install() 
does nothing.

//Peter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-27 21:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 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.