1 | # $Id: TARGZ.kmk 1547 2008-04-22 02:02:09Z bird $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - tar.gz unpacker.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2006-2008 knut st. osmundsen <bird-kBuild-spam@anduin.net>
|
---|
8 | #
|
---|
9 | #
|
---|
10 | # This file is part of kBuild.
|
---|
11 | #
|
---|
12 | # kBuild is free software; you can redistribute it and/or modify
|
---|
13 | # it under the terms of the GNU General Public License as published by
|
---|
14 | # the Free Software Foundation; either version 2 of the License, or
|
---|
15 | # (at your option) any later version.
|
---|
16 | #
|
---|
17 | # kBuild is distributed in the hope that it will be useful,
|
---|
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
20 | # GNU General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with kBuild; if not, write to the Free Software
|
---|
24 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
25 | #
|
---|
26 | #
|
---|
27 | # As a special exception you are granted permission to include this file, via
|
---|
28 | # the kmk include directive, as you wish without this in itself causing the
|
---|
29 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
30 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
31 | # program, whatever should not be covered the GPL.
|
---|
32 | #
|
---|
33 | #
|
---|
34 |
|
---|
35 | TOOL_TARGZ := tar.gz unpacker.
|
---|
36 |
|
---|
37 | # Tool Specific Properties
|
---|
38 | ifndef TOOL_TARGZ_TAR
|
---|
39 | TOOL_TARGZ_TAR := $(wildcard $(PATH_DEVTOOLS_BLD)/tar/v*/tar$(HOSTSUFF_EXE))
|
---|
40 | ifeq ($(TOOL_TARGZ_TAR),)
|
---|
41 | TOOL_TARGZ_TAR := $(wildcard $(PATH_DEVTOOLS_BLD)/bin/tar$(HOSTSUFF_EXE))
|
---|
42 | endif
|
---|
43 | ifeq ($(TOOL_TARGZ_TAR),)
|
---|
44 | TOOL_TARGZ_TAR := $(TOOL_TAR_TAR)
|
---|
45 | endif
|
---|
46 | ifeq ($(TOOL_TARGZ_TAR),)
|
---|
47 | TOOL_TARGZ_TAR := $(lastword $(sort $(TOOL_TARGZ_TAR)))
|
---|
48 | else
|
---|
49 | TOOL_TARGZ_TAR := tar$(HOSTSUFF_EXE)
|
---|
50 | endif
|
---|
51 | else
|
---|
52 | TOOL_TARGZ_TAR := $(TOOL_TARGZ_TAR)
|
---|
53 | endif
|
---|
54 | TOOL_TARGZ_UNPACK ?= $(TOOL_TARGZ_TAR)
|
---|
55 |
|
---|
56 | # General Properties used by kBuild
|
---|
57 | TOOL_TARGZ_UNPACKFLAGS ?= -z
|
---|
58 |
|
---|
59 | ## UNPACK one file.
|
---|
60 | # @param $(target) Normalized main target name.
|
---|
61 | # @param $(archive) The file to unpack.
|
---|
62 | # @param $(flags) Flags.
|
---|
63 | # @param $(inst) Where to unpack it.
|
---|
64 | # @param $(out) Where to write the file list.
|
---|
65 | TOOL_TARGZ_UNPACK_OUTPUT =
|
---|
66 | TOOL_TARGZ_UNPACK_DEPEND =
|
---|
67 | TOOL_TARGZ_UNPACK_DEPORD =
|
---|
68 | define TOOL_TARGZ_UNPACK_CMDS
|
---|
69 | $(QUIET)$(TOOL_TARGZ_UNPACK) -x $(flags) -C $(inst) -f $(archive)
|
---|
70 | $(QUIET)$(TOOL_TARGZ_UNPACK) -t $(flags) -f $(archive) > $(out)
|
---|
71 | endef
|
---|
72 |
|
---|