From patchwork Tue Apr 3 20:49:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 150542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id EE2BCB6FE6 for ; Wed, 4 Apr 2012 06:53:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 98DBC10205D; Tue, 3 Apr 2012 20:53:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9EZJy5jFEJC4; Tue, 3 Apr 2012 20:53:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 88DBC101EBC; Tue, 3 Apr 2012 20:53:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 991058F753 for ; Tue, 3 Apr 2012 20:53:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 95F59A00BF for ; Tue, 3 Apr 2012 20:53:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BPEQ8Szv2pXH for ; Tue, 3 Apr 2012 20:53:17 +0000 (UTC) Received: from busybox.osuosl.org (busybox.osuosl.org [140.211.167.224]) by hemlock.osuosl.org (Postfix) with ESMTP id DC301A0025 for ; Tue, 3 Apr 2012 20:53:17 +0000 (UTC) Received: by busybox.osuosl.org (Postfix, from userid 4021) id D3E40969F0; Tue, 3 Apr 2012 20:53:17 +0000 (UTC) From: Peter Korsgaard To: buildroot@busybox.net Date: Tue, 3 Apr 2012 22:49:06 +0200 X-Git-Refname: refs/heads/master X-Git-Oldrev: 56ece03c81a792f2dba0c5cbff609a45a13bde59 X-Git-Newrev: 21fb8e68ee656733a02ff3f574b991d5032cdfc3 X-Patchwork-Hint: ignore Message-Id: <20120403205317.D3E40969F0@busybox.osuosl.org> Subject: [Buildroot] [git commit] tinyhttpd: convert to gentargets X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net commit: http://git.buildroot.net/buildroot/commit/?id=21fb8e68ee656733a02ff3f574b991d5032cdfc3 branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master [Peter: misc fixes, make invocation, use install -D] Signed-off-by: Maxime Ripard Signed-off-by: Peter Korsgaard --- package/tinyhttpd/tinyhttpd.mk | 66 +++++++++++----------------------------- 1 files changed, 18 insertions(+), 48 deletions(-) diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk index 0f95d06..6bc37d4 100644 --- a/package/tinyhttpd/tinyhttpd.mk +++ b/package/tinyhttpd/tinyhttpd.mk @@ -3,54 +3,24 @@ # tinyhttpd # ############################################################# -TINYHTTPD_VER:=0.1.0 -TINYHTTPD_SOURCE:=tinyhttpd-$(TINYHTTPD_VER).tar.gz -TINYHTTPD_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/tinyhttpd/$(TINYHTTPD_SOURCE) -TINYHTTPD_DIR:=$(BUILD_DIR)/tinyhttpd-$(TINYHTTPD_VER) -TINYHTTPD_CAT:=$(ZCAT) -TINYHTTPD_BINARY:=httpd -TINYHTTPD_TARGET_BINARY:=usr/sbin/tinyhttpd - -$(DL_DIR)/$(TINYHTTPD_SOURCE): - $(call DOWNLOAD,$(TINYHTTPD_SITE)/$(TINYHTTPD_SOURCE)) - -tinyhttpd-source: $(DL_DIR)/$(TINYHTTPD_SOURCE) - -############################################################# -# -# build tinyhttpd for use on the target system -# -############################################################# -$(TINYHTTPD_DIR)/.unpacked: $(DL_DIR)/$(TINYHTTPD_SOURCE) - $(TINYHTTPD_CAT) $(DL_DIR)/$(TINYHTTPD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - support/scripts/apply-patches.sh $(TINYHTTPD_DIR) package/tinyhttpd/ tinyhttpd\*.patch - touch $(TINYHTTPD_DIR)/.unpacked - -$(TINYHTTPD_DIR)/$(TINYHTTPD_BINARY): $(TINYHTTPD_DIR)/.unpacked - $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(TINYHTTPD_DIR) - -$(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY): $(TINYHTTPD_DIR)/$(TINYHTTPD_BINARY) - $(INSTALL) -m 0755 $(TINYHTTPD_DIR)/$(TINYHTTPD_BINARY) $(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY) - $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY) - $(INSTALL) -m 0755 package/tinyhttpd/S85tinyhttpd $(TARGET_DIR)/etc/init.d +TINYHTTPD_VERSION = 0.1.0 +TINYHTTPD_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/tinyhttpd/ + +define TINYHTTPD_BUILD_CMDS + $(MAKE) -C $(@D) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" +endef + +define TINYHTTPD_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/httpd $(TARGET_DIR)/usr/sbin/httpd + $(INSTALL) -m 0755 -D package/tinyhttpd/S85tinyhttpd \ + $(TARGET_DIR)/etc/init.d/S85tinyhttpd mkdir -p $(TARGET_DIR)/var/www +endef -tinyhttpd: $(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY) - -tinyhttpd-clean: - -$(MAKE) -C $(TINYHTTPD_DIR) clean - @rm -f $(TARGET_DIR)/$(TINYHTTPD_TARGET_BINARY) - @rm -f $(TARGET_DIR)/etc/init.d/S85tinyhttpd - @rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/var/www +define TINYHTTPD_CLEAN_CMDS + rm -f $(TARGET_DIR)/usr/sbin/httpd + rm -f $(TARGET_DIR)/etc/init.d/S85tinyhttpd +endef -tinyhttpd-dirclean: - rm -rf $(TINYHTTPD_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_TINYHTTPD),y) -TARGETS+=tinyhttpd -endif +$(eval $(call GENTARGETS))