From 3692b63fb1b94fe93b40336f97657d77bf0011bd Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Thu, 6 Jul 2017 21:08:05 +0200 Subject: [PATCH] linuxptp: refactor with LINUXPTP_MAKE_{ENV,OPTS} variables Since there is quite some duplication in the variables to be passed in the make environment and as make options between the build and install steps, this commit introduces LINUXPTP_MAKE_ENV and LINUXPTP_MAKE_OPTS to avoid the duplication. Signed-off-by: Thomas Petazzoni --- package/linuxptp/linuxptp.mk | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/package/linuxptp/linuxptp.mk b/package/linuxptp/linuxptp.mk index d8bcc2bf95..6516659303 100644 --- a/package/linuxptp/linuxptp.mk +++ b/package/linuxptp/linuxptp.mk @@ -10,27 +10,23 @@ LINUXPTP_SITE = git://git.code.sf.net/p/linuxptp/code LINUXPTP_LICENSE = GPL-2.0+ LINUXPTP_LICENSE_FILES = COPYING -define LINUXPTP_BUILD_CMDS +LINUXPTP_MAKE_ENV = \ $(TARGET_MAKE_ENV) \ CROSS_COMPILE="$(TARGET_CROSS)" \ KBUILD_OUTPUT=$(STAGING_DIR) \ - $(MAKE) \ - prefix=/usr \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ - -C $(@D) all + +LINUXPTP_MAKE_OPTS = \ + prefix=/usr \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ + +define LINUXPTP_BUILD_CMDS + $(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) -C $(@D) all endef define LINUXPTP_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_OUTPUT=$(STAGING_DIR) \ - $(MAKE) \ - prefix=/usr \ - DESTDIR=$(TARGET_DIR) \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ - -C $(@D) install + $(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) \ + DESTDIR=$(TARGET_DIR) -C $(@D) install $(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp.cfg \ $(TARGET_DIR)/etc/linuxptp.cfg -- 2.30.2