Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hamish Moffatt <hamish@cloud.net.au>
To: buildroot@busybox.net
Subject: [Buildroot] question about make
Date: Tue, 29 Apr 2008 11:04:39 +1000	[thread overview]
Message-ID: <20080429010439.GB23316@cloud.net.au> (raw)
In-Reply-To: <46a136670804281005t11bcda79mb985e6b78b25e717@mail.gmail.com>

On Mon, Apr 28, 2008 at 01:05:33PM -0400, John Voltz wrote:
> I'm hoping someone can help me figure out the best way to fix the buildroot
> makefiles for the festival voices and lexicons, right now make doesn't check
> to see if you have already downloaded the tarball before it does it again.
> What's the easiest way to check for the existence of a file with make?

Make something depend on it, and add a rule to download it to fulfill
the dependency. Random example (from gzip.mk);

$(DL_DIR)/$(GZIP_SOURCE):
	 $(WGET) -P $(DL_DIR) $(GZIP_SITE)/$(GZIP_SOURCE)

gzip-source: $(DL_DIR)/$(GZIP_SOURCE)

$(GZIP_DIR)/.unpacked: $(DL_DIR)/$(GZIP_SOURCE)
	$(GZIP_CAT) $(DL_DIR)/$(GZIP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	touch $(GZIP_DIR)/.unpacked

> This is the very simplistic method that is currently used for grabbing the
> lexicons:
> 
> $(FESTLEX_STATUS_DIR)/.downloaded:
>     mkdir -p $(FESTLEX_STATUS_DIR)
> ifeq ($(BR2_PACKAGE_FESTLEX_CMU),y)
>     $(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX1)
> endif
> ifeq ($(BR2_PACKAGE_FESTLEX_OALD),y)
>     $(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX2)
> endif
> ifeq ($(BR2_PACKAGE_FESTLEX_POS),y)
>     $(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX3)
> endif
>     touch $@

You probably want to write something like:

$(DL_DIR)/$(LEX1):
	$(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX1)
$(DL_DIR)/$(LEX2):
	$(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX2)
$(DL_DIR)/$(LEX3):
	$(WGET) -P $(DL_DIR) $(FESTIVAL_SITE)/$(LEX3)

FESTLEX_DOWNLOAD_$(BR2_PACKAGE_FESTLEX_CMU) += $(DL_DIR)/$(LEX1)
FESTLEX_DOWNLOAD_$(BR2_PACKAGE_FESTLEX_OALD) += $(DL_DIR)/$(LEX2)
FESTLEX_DOWNLOAD_$(BR2_PACKAGE_FESTLEX_POS) += $(DL_DIR)/$(LEX3)

$(FESTLEX_DIR)/.unpacked: $(FESTLEX_DOWNLOAD_y)
	...


Hamish
-- 
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>

      reply	other threads:[~2008-04-29  1:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 17:05 [Buildroot] question about make John Voltz
2008-04-29  1:04 ` Hamish Moffatt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080429010439.GB23316@cloud.net.au \
    --to=hamish@cloud.net.au \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox