Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/lz4: simplify build/install logic
@ 2020-07-27 16:20 Peter Korsgaard
  2020-07-27 21:09 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Korsgaard @ 2020-07-27 16:20 UTC (permalink / raw)
  To: buildroot

No functional change.

Rather than tracking both build targets and sub directory to run 'make
install' from, use a make loop for the staging/target install logic, similar
to how we are doing it to for the build step and directly use the Makefile
in the sub directory rather than the helper lib/lz4 targets in the top level
Makefile.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/lz4/lz4.mk | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/package/lz4/lz4.mk b/package/lz4/lz4.mk
index 1cdd39106c..fa309e8dbb 100644
--- a/package/lz4/lz4.mk
+++ b/package/lz4/lz4.mk
@@ -32,29 +32,31 @@ define HOST_LZ4_INSTALL_CMDS
 		install -C $(@D)
 endef
 
+LZ4_DIRS = lib
+
 ifeq ($(BR2_PACKAGE_LZ4_PROGS),y)
-LZ4_BUILD_TARGETS = lib lz4
-LZ4_INSTALL_OPTS = install -C $(@D)
-else
-LZ4_BUILD_TARGETS = lib
-LZ4_INSTALL_OPTS = install -C $(@D)/lib
+LZ4_DIRS += programs
 endif
 
 define LZ4_BUILD_CMDS
-	$(foreach target,$(LZ4_BUILD_TARGETS),\
+	$(foreach dir,$(LZ4_DIRS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
-			-C $(@D) $(target)
+			-C $(@D)/$(dir)
 	)
 endef
 
 define LZ4_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
-		PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
+	$(foreach dir,$(LZ4_DIRS),\
+		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
+			PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
+	)
 endef
 
 define LZ4_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
-		PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
+	$(foreach dir,$(LZ4_DIRS),\
+		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
+			PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
+	)
 endef
 
 $(eval $(generic-package))
-- 
2.20.1

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

* [Buildroot] [PATCH] package/lz4: simplify build/install logic
  2020-07-27 16:20 [Buildroot] [PATCH] package/lz4: simplify build/install logic Peter Korsgaard
@ 2020-07-27 21:09 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2020-07-27 21:09 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2020-07-27 18:20 +0200, Peter Korsgaard spake thusly:
> No functional change.
> 
> Rather than tracking both build targets and sub directory to run 'make
> install' from, use a make loop for the staging/target install logic, similar
> to how we are doing it to for the build step and directly use the Makefile
> in the sub directory rather than the helper lib/lz4 targets in the top level
> Makefile.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/lz4/lz4.mk | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/package/lz4/lz4.mk b/package/lz4/lz4.mk
> index 1cdd39106c..fa309e8dbb 100644
> --- a/package/lz4/lz4.mk
> +++ b/package/lz4/lz4.mk
> @@ -32,29 +32,31 @@ define HOST_LZ4_INSTALL_CMDS
>  		install -C $(@D)
>  endef
>  
> +LZ4_DIRS = lib
> +
>  ifeq ($(BR2_PACKAGE_LZ4_PROGS),y)
> -LZ4_BUILD_TARGETS = lib lz4
> -LZ4_INSTALL_OPTS = install -C $(@D)
> -else
> -LZ4_BUILD_TARGETS = lib
> -LZ4_INSTALL_OPTS = install -C $(@D)/lib
> +LZ4_DIRS += programs
>  endif
>  
>  define LZ4_BUILD_CMDS
> -	$(foreach target,$(LZ4_BUILD_TARGETS),\
> +	$(foreach dir,$(LZ4_DIRS),\
>  		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
> -			-C $(@D) $(target)
> +			-C $(@D)/$(dir)
>  	)
>  endef
>  
>  define LZ4_INSTALL_STAGING_CMDS
> -	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
> -		PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
> +	$(foreach dir,$(LZ4_DIRS),\
> +		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
> +			PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
> +	)
>  endef
>  
>  define LZ4_INSTALL_TARGET_CMDS
> -	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
> -		PREFIX=/usr $(LZ4_MAKE_OPTS) $(LZ4_INSTALL_OPTS)
> +	$(foreach dir,$(LZ4_DIRS),\
> +		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
> +			PREFIX=/usr $(LZ4_MAKE_OPTS) -C $(@D)/$(dir) install
> +	)
>  endef
>  
>  $(eval $(generic-package))
> -- 
> 2.20.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2020-07-27 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-27 16:20 [Buildroot] [PATCH] package/lz4: simplify build/install logic Peter Korsgaard
2020-07-27 21:09 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox