Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] question about make
@ 2008-04-28 17:05 John Voltz
  2008-04-29  1:04 ` Hamish Moffatt
  0 siblings, 1 reply; 2+ messages in thread
From: John Voltz @ 2008-04-28 17:05 UTC (permalink / raw)
  To: buildroot

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?

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 $@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/buildroot/attachments/20080428/53688978/attachment.htm 

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

* [Buildroot] question about make
  2008-04-28 17:05 [Buildroot] question about make John Voltz
@ 2008-04-29  1:04 ` Hamish Moffatt
  0 siblings, 0 replies; 2+ messages in thread
From: Hamish Moffatt @ 2008-04-29  1:04 UTC (permalink / raw)
  To: buildroot

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>

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

end of thread, other threads:[~2008-04-29  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-28 17:05 [Buildroot] question about make John Voltz
2008-04-29  1:04 ` Hamish Moffatt

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