# -*-makefile-*- # $Id$ # # Copyright (C) 2002 by Pengutronix e.K., Hildesheim, Germany # See CREDITS for details about who has contributed to this project. # # For further information about the PTXdist project and license conditions # see the README file. # # # We provide this package # PACKAGES-$(PTXCONF_FLASH) += flash # # Paths and names # FLASH_VERSION = 0.9.5 FLASH = flash-$(FLASH_VERSION) FLASH_URL = http://www.netsoc.ucd.ie/flash/$(FLASH).tar.gz FLASH_SOURCE = $(SRCDIR)/$(FLASH).tar.gz FLASH_DIR = $(BUILDDIR)/$(FLASH) FLASH_EXTRACT = gzip -dc # FIXME: RSC: convert this to use the patch repository; this is a bugfix patch! FLASH_PATCH = flash-$(FLASH_VERSION)-ptx2.diff FLASH_PATCH_URL = http://www.pengutronix.de/software/ptxdist/temporary-src/$(FLASH_PATCH) FLASH_PATCH_SOURCE = $(SRCDIR)/$(FLASH_PATCH) FLASH_PATCH_EXTRACT = cat -include $(call package_depfile) # ---------------------------------------------------------------------------- # Get # ---------------------------------------------------------------------------- flash_get: $(STATEDIR)/flash.get flash_get_deps = $(FLASH_SOURCE) flash_get_deps += $(FLASH_PATCH_SOURCE) flash_get_deps += $(STATEDIR)/flash-patches.get $(STATEDIR)/flash.get: $(flash_get_deps) @$(call targetinfo, $@) @$(call touch, $@) $(STATEDIR)/flash-patches.get: @$(call targetinfo, $@) @$(call get_patches, $(FLASH)) @$(call touch, $@) $(FLASH_SOURCE): @$(call targetinfo, $@) @$(call get, $(FLASH_URL)) $(FLASH_PATCH_SOURCE): @$(call targetinfo, $@) @$(call get, $(FLASH_PATCH_URL)) # ---------------------------------------------------------------------------- # Extract # ---------------------------------------------------------------------------- flash_extract: $(STATEDIR)/flash.extract $(STATEDIR)/flash.extract: $(STATEDIR)/flash.get @$(call targetinfo, $@) $(FLASH_EXTRACT) $(FLASH_SOURCE) | $(TAR) -C $(BUILDDIR) -xf - cd $(FLASH_DIR) && patch -p1 < $(FLASH_PATCH_SOURCE) @$(call patchin, $(FLASH), $(FLASH_DIR)) @$(call touch, $@) # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- flash_prepare: $(STATEDIR)/flash.prepare # # dependencies # flash_prepare_deps = \ $(STATEDIR)/virtual-xchain.install \ $(STATEDIR)/ncurses.install \ $(STATEDIR)/autoconf257.install \ $(STATEDIR)/flash.extract FLASH_PATH = PATH=$(PTXCONF_PREFIX)/$(AUTOCONF257)/bin:$(CROSS_PATH) FLASH_ENV = $(CROSS_ENV) # # autoconf # FLASH_AUTOCONF = $(CROSS_AUTOCONF_USR) FLASH_AUTOCONF += --with-ncurses-path=$(NCURSES_DIR) $(STATEDIR)/flash.prepare: $(flash_prepare_deps) @$(call targetinfo, $@) @$(call clean, $(FLASH_BUILDDIR)) mkdir -p $(FLASH_DIR) rm -f $(FLASH_DIR)/configure cd $(FLASH_DIR) && autoconf # # Workaround for broken autoconf magic for cross compilation cd $(FLASH_DIR) && \ ac_cv_func_getpgrp_void=yes \ ac_cv_func_setpgrp_void=yes \ ac_cv_sizeof_long_long=8 \ ac_cv_func_memcmp_clean=yes \ ac_cv_func_getrlimit=yes \ $(FLASH_PATH) $(FLASH_ENV) $(FLASH_DIR)/configure $(FLASH_AUTOCONF) @$(call touch, $@) # ---------------------------------------------------------------------------- # Compile # ---------------------------------------------------------------------------- flash_compile: $(STATEDIR)/flash.compile $(STATEDIR)/flash.compile: $(STATEDIR)/flash.prepare @$(call targetinfo, $@) $(FLASH_PATH) $(FLASH_ENV) make -C $(FLASH_DIR) @$(call touch, $@) # ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- flash_install: $(STATEDIR)/flash.install $(STATEDIR)/flash.install: $(STATEDIR)/flash.compile @$(call targetinfo, $@) # FIXME #@$(call install, FLASH) @$(call touch, $@) # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- flash_targetinstall: $(STATEDIR)/flash.targetinstall flash_targetinstall_deps = $(STATEDIR)/flash.install flash_targetinstall_deps += $(STATEDIR)/ncurses.targetinstall $(STATEDIR)/flash.targetinstall: $(flash_targetinstall_deps) @$(call targetinfo, $@) @$(call install_init,default) @$(call install_fixup,PACKAGE,flash) @$(call install_fixup,PRIORITY,optional) @$(call install_fixup,VERSION,$(FLASH_VERSION)) @$(call install_fixup,SECTION,base) @$(call install_fixup,AUTHOR,"Robert Schwebel ") @$(call install_fixup,DEPENDS,) @$(call install_fixup,DESCRIPTION,missing) @$(call install_copy, 0, 0, 0755, $(FLASH_DIR)/flash, /usr/bin/flash) # FIMXE: RSC: permissions? @$(call install_copy, 0, 0, 0755, $(FLASH_DIR)/modules/alarms, /usr/lib/flash/alarms) @$(call install_copy, 0, 0, 0755, $(FLASH_DIR)/modules/background, /usr/lib/flash/background) @$(call install_copy, 0, 0, 0755, $(FLASH_DIR)/modules/countdown, /usr/lib/flash/countdown) @$(call install_finish) @$(call touch, $@) # ---------------------------------------------------------------------------- # Clean # ---------------------------------------------------------------------------- flash_clean: rm -fr $(STATEDIR)/flash.* rm -fr $(IMAGEDIR)/flash_* rm -fr $(FLASH_DIR) # vim: syntax=make