From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Sat, 18 Sep 2010 19:19:44 +0200 Subject: [Buildroot] [PATCH 18/21] ntp: convert to autotargets and bump to 4.2.6p2 In-Reply-To: <1284435648-15238-18-git-send-email-Martin.Banky@gmail.com> References: <1284435648-15238-1-git-send-email-Martin.Banky@gmail.com> <1284435648-15238-18-git-send-email-Martin.Banky@gmail.com> Message-ID: <20100918191944.612fee30@surf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello ! On Mon, 13 Sep 2010 20:40:45 -0700 Martin Banky wrote: > +config BR2_PACKAGE_NTP_NTP-KEYGEN Please don't use the dash character in configuration options. This should be BR2_PACKAGE_NTP_KEYGEN or BR2_PACKAGE_NTP_NTP_KEYGEN. > +NTP_DIR = $(BUILD_DIR)/ntp-$(NTP_VERSION) Not needed. > +NTP_CAT = $(ZCAT) Not needed. > ifeq ($(BR2_PACKAGE_NTP_SNTP),y) > +define NTP_INSTALL_SNTP > install -m 755 $(NTP_DIR)/sntp/sntp $(TARGET_DIR)/usr/bin/sntp > +endef > +endif Instead of $(NTP_DIR), use $(@D). > + > +ifeq ($(BR2_PACKAGE_NTP_NTP-KEYGEN),y) > +define NTP_INSTALL_NTP-KEYGEN > + install -m 755 $(NTP_DIR)/util/ntp-keygen $(TARGET_DIR)/usr/bin/ntp-keygen > +endef > +endif > + > +ifeq ($(BR2_PACKAGE_NTP_NTP-WAIT),y) > +define NTP_INSTALL_NTP-WAIT > + install -m 755 $(NTP_DIR)/scripts/ntp-wait $(TARGET_DIR)/usr/bin/ntp-wait > +endef > +endif > + > +ifeq ($(BR2_PACKAGE_NTP_NTPDC),y) > +define NTP_INSTALL_NTPDC > + install -m 755 $(NTP_DIR)/ntpdc/ntpdc $(TARGET_DIR)/usr/bin/ntpdc > +endef > +endif > + > +ifeq ($(BR2_PACKAGE_NTP_NTPQ),y) > +define NTP_INSTALL_NTPQ > + install -m 755 $(NTP_DIR)/ntpq/ntpq $(TARGET_DIR)/usr/bin/ntpq > +endef > +endif > + > +ifeq ($(BR2_PACKAGE_NTP_NTPTRACE),y) > +define NTP_INSTALL_NTPTRACE > + install -m 755 $(NTP_DIR)/scripts/ntptrace $(TARGET_DIR)/usr/bin/ntptrace > +endef > +endif > + > +ifeq ($(BR2_PACKAGE_NTP_TICKADJ),y) > +define NTP_INSTALL_TICKADJ > + install -m 755 $(NTP_DIR)/util/tickadj $(TARGET_DIR)/usr/bin/tickadj > +endef > endif > + > +define NTP_INSTALL_TARGET_CMDS > + install -m 755 $(NTP_DIR)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd > + $(NTP_INSTALL_SNTP) > + $(NTP_INSTALL_NTP-KEYGEN) > + $(NTP_INSTALL_NTP-WAIT) > + $(NTP_INSTALL_NTPDC) > + $(NTP_INSTALL_NTPQ) > + $(NTP_INSTALL_NTPTRACE) > + $(NTP_INSTALL_TICKADJ) Humm, you could rewrite this this way: NTP_INSTALL_BIN_FILES = ifeq ($(BR2_PACKAGE_NTP_NTP_KEYGEN),y) NTP_INSTALL_BIN_FILES += util/ntp-keygen endif ifeq ($(BR2_PACKAGE_NTP_NTP-WAIT),y) NTP_INSTALL_BIN_FILES += scripts/ntp-wait endif ... and then : define NTP_INSTALL_TARGET_CMDS install -m 755 $(NTP_DIR)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd test -z "$(NTP_INSTALL_BIN_FILES)" || install -m 755 $(addprefix $(@D),$(NTP_INSTALL_BIN_FILES)) $(TARGET_DIR)/usr/bin/ endif and finally : define NTP_UNINSTALL_TARGET_CMDS rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(NTP_INSTALL_BIN_FILES)) endif Regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com