summaryrefslogtreecommitdiffstats
path: root/rules/host-cramfs.make
blob: 7592a372814e15b1222c002759a5b6a0b43a846a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2007 by Robert Schwebel
#
# 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
#
HOST_PACKAGES-$(PTXCONF_HOST_CRAMFS) += host-cramfs

#
# Paths and names
#
HOST_CRAMFS_VERSION	:= 1.1
HOST_CRAMFS		:= cramfs-$(HOST_CRAMFS_VERSION)
HOST_CRAMFS_SUFFIX	:= tar.gz
HOST_CRAMFS_URL		:= $(PTXCONF_SETUP_SFMIRROR)/cramfs/$(HOST_CRAMFS).$(HOST_CRAMFS_SUFFIX)
HOST_CRAMFS_SOURCE	:= $(SRCDIR)/$(HOST_CRAMFS).$(HOST_CRAMFS_SUFFIX)
HOST_CRAMFS_DIR		:= $(HOST_BUILDDIR)/$(HOST_CRAMFS)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

host-cramfs_get: $(STATEDIR)/host-cramfs.get

$(STATEDIR)/host-cramfs.get: $(host-cramfs_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(HOST_CRAMFS_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, HOST_CRAMFS)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

host-cramfs_extract: $(STATEDIR)/host-cramfs.extract

$(STATEDIR)/host-cramfs.extract: $(host-cramfs_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(HOST_CRAMFS_DIR))
	@$(call extract, HOST_CRAMFS, $(HOST_BUILDDIR))
	@$(call patchin, HOST_CRAMFS, $(HOST_CRAMFS_DIR))
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

host-cramfs_prepare: $(STATEDIR)/host-cramfs.prepare

HOST_CRAMFS_PATH	:= PATH=$(HOST_PATH)
HOST_CRAMFS_ENV 	:= $(HOST_ENV)

#
# autoconf
#
HOST_CRAMFS_AUTOCONF	:= $(HOST_AUTOCONF)

$(STATEDIR)/host-cramfs.prepare: $(host-cramfs_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(HOST_CRAMFS_DIR)/config.cache)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

host-cramfs_compile: $(STATEDIR)/host-cramfs.compile

$(STATEDIR)/host-cramfs.compile: $(host-cramfs_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(HOST_CRAMFS_DIR) && \
		$(HOST_CRAMFS_PATH) $(HOST_CRAMFS_ENV) $(MAKE) $(PARALLELMFLAGS) CPPFLAGS="-I. $(HOST_CPPFLAGS)"
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

host-cramfs_install: $(STATEDIR)/host-cramfs.install

$(STATEDIR)/host-cramfs.install: $(host-cramfs_install_deps_default)
	@$(call targetinfo, $@)
	cp $(HOST_CRAMFS_DIR)/mkcramfs $(PTXCONF_SYSROOT_HOST)/bin
	cp $(HOST_CRAMFS_DIR)/cramfsck $(PTXCONF_SYSROOT_HOST)/bin
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

host-cramfs_clean:
	rm -rf $(STATEDIR)/host-cramfs.*
	rm -rf $(HOST_CRAMFS_DIR)

# vim: syntax=make