| 1 | # $Id: TAR.kmk 819 2007-02-01 02:28:30Z bird $
|
|---|
| 2 | ## @file
|
|---|
| 3 | #
|
|---|
| 4 | # kBuild Tool Config - tar unpacker.
|
|---|
| 5 | #
|
|---|
| 6 | # Copyright (c) 2006-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
|
|---|
| 7 | #
|
|---|
| 8 | #
|
|---|
| 9 | # This file is part of kBuild.
|
|---|
| 10 | #
|
|---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
|---|
| 12 | # it under the terms of the GNU General Public License as published by
|
|---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
|---|
| 14 | # (at your option) any later version.
|
|---|
| 15 | #
|
|---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | # GNU General Public License for more details.
|
|---|
| 20 | #
|
|---|
| 21 | # You should have received a copy of the GNU General Public License
|
|---|
| 22 | # along with kBuild; if not, write to the Free Software
|
|---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 24 | #
|
|---|
| 25 | #
|
|---|
| 26 |
|
|---|
| 27 | TOOL_TAR := tar unpacker.
|
|---|
| 28 |
|
|---|
| 29 | # Tool Specific Properties
|
|---|
| 30 | ifndef TOOL_TAR_TAR
|
|---|
| 31 | TOOL_TAR_TAR := $(wildcard $(PATH_DEVTOOLS_BLD)/tar/v*/tar$(HOSTSUFF_EXE))
|
|---|
| 32 | ifeq ($(TOOL_TAR_TAR),)
|
|---|
| 33 | TOOL_TAR_TAR := $(wildcard $(PATH_DEVTOOLS_BLD)/bin/tar$(HOSTSUFF_EXE))
|
|---|
| 34 | endif
|
|---|
| 35 | ifeq ($(TOOL_TAR_TAR),)
|
|---|
| 36 | TOOL_TAR_TAR := $(lastword $(sort $(TOOL_TAR_TAR)))
|
|---|
| 37 | else
|
|---|
| 38 | TOOL_TAR_TAR := tar$(HOSTSUFF_EXE)
|
|---|
| 39 | endif
|
|---|
| 40 | else
|
|---|
| 41 | TOOL_TAR_TAR := $(TOOL_TAR_TAR)
|
|---|
| 42 | endif
|
|---|
| 43 | TOOL_TAR_UNPACK ?= $(TOOL_TAR_TAR)
|
|---|
| 44 |
|
|---|
| 45 | # General Properties used by kBuild
|
|---|
| 46 | TOOL_TAR_UNPACKFLAGS ?=
|
|---|
| 47 |
|
|---|
| 48 | ## UNPACK one file.
|
|---|
| 49 | # @param $(target) Normalized main target name.
|
|---|
| 50 | # @param $(archive) The file to unpack.
|
|---|
| 51 | # @param $(flags) Flags.
|
|---|
| 52 | # @param $(inst) Where to unpack it.
|
|---|
| 53 | # @param $(out) Where to write the file list.
|
|---|
| 54 | TOOL_TAR_UNPACK_OUTPUT =
|
|---|
| 55 | TOOL_TAR_UNPACK_DEPEND =
|
|---|
| 56 | TOOL_TAR_UNPACK_DEPORD =
|
|---|
| 57 | ifeq ($(BUILD_PLATFORM),win) # hacking with buggy unxutils on windows. it doesn't like driver letters.
|
|---|
| 58 | define TOOL_TAR_UNPACK_CMDS
|
|---|
| 59 | $(QUIET)$(TOOL_TAR_UNPACK) -x $(flags) -C $(subst G:,,$(inst)) -f $(archive)
|
|---|
| 60 | $(QUIET)$(TOOL_TAR_UNPACK) -t $(flags) -f $(archive) > $(out)
|
|---|
| 61 | endef
|
|---|
| 62 | else
|
|---|
| 63 | define TOOL_TAR_UNPACK_CMDS
|
|---|
| 64 | $(QUIET)$(TOOL_TAR_UNPACK) -x $(flags) -C $(inst) -f $(archive)
|
|---|
| 65 | $(QUIET)$(TOOL_TAR_UNPACK) -t $(flags) -f $(archive) > $(out)
|
|---|
| 66 | endef
|
|---|
| 67 | endif
|
|---|
| 68 |
|
|---|