summaryrefslogtreecommitdiffstats
path: root/rules/host-umkimage.make
blob: 06608cf97ae5933fd2502eb44d55ffefd283859e (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# -*-makefile-*-
#
# Copyright (C) 2003 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
#
HOST_PACKAGES-$(PTXCONF_HOST_UMKIMAGE) += host-umkimage

#
# Paths and names
#
HOST_UMKIMAGE_VERSION	= 1.1.2
HOST_UMKIMAGE		= u-boot-mkimage-$(HOST_UMKIMAGE_VERSION)
HOST_UMKIMAGE_SUFFIX	= tar.gz
HOST_UMKIMAGE_URL		= http://www.pengutronix.de/software/ptxdist/temporary-src/$(HOST_UMKIMAGE).$(HOST_UMKIMAGE_SUFFIX)
HOST_UMKIMAGE_SOURCE	= $(SRCDIR)/$(HOST_UMKIMAGE).$(HOST_UMKIMAGE_SUFFIX)
HOST_UMKIMAGE_DIR		= $(HOST_BUILDDIR)/$(HOST_UMKIMAGE)

-include $(call package_depfile)

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

host-umkimage_get: $(STATEDIR)/host-umkimage.get

host-umkimage_get_deps = $(HOST_UMKIMAGE_SOURCE)

$(STATEDIR)/host-umkimage.get: $(host-umkimage_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(HOST_UMKIMAGE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(HOST_UMKIMAGE_URL))

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

host-umkimage_extract: $(STATEDIR)/host-umkimage.extract

host-umkimage_extract_deps = $(STATEDIR)/host-umkimage.get

$(STATEDIR)/host-umkimage.extract: $(host-umkimage_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(HOST_UMKIMAGE_DIR))
	@$(call extract, $(HOST_UMKIMAGE_SOURCE), $(HOST_BUILDDIR))
	@$(call touch, $@)

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

host-umkimage_prepare: $(STATEDIR)/host-umkimage.prepare

#
# dependencies
#
host-umkimage_prepare_deps =  $(STATEDIR)/host-umkimage.extract
host-umkimage_prepare_deps += $(STATEDIR)/host-zlib.install

HOST_UMKIMAGE_MAKEVARS	= CC=$(HOSTCC)
HOST_UMKIMAGE_ENV		= CFLAGS=-I$(PTXCONF_PREFIX)/include

$(STATEDIR)/host-umkimage.prepare: $(host-umkimage_prepare_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

host-umkimage_compile: $(STATEDIR)/host-umkimage.compile

host-umkimage_compile_deps = $(STATEDIR)/host-umkimage.prepare

$(STATEDIR)/host-umkimage.compile: $(host-umkimage_compile_deps)
	@$(call targetinfo, $@)
	$(HOST_UMKIMAGE_ENV) make -C $(HOST_UMKIMAGE_DIR) $(HOST_UMKIMAGE_MAKEVARS)
	@$(call touch, $@)

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

host-umkimage_install: $(STATEDIR)/host-umkimage.install

$(STATEDIR)/host-umkimage.install: $(STATEDIR)/host-umkimage.compile
	@$(call targetinfo, $@)
	# FIXME
	mkdir -p $(PTXCONF_PREFIX)/usr/bin
	install $(HOST_UMKIMAGE_DIR)/mkimage $(PTXCONF_PREFIX)/bin/u-boot-mkimage
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

host-umkimage_targetinstall: $(STATEDIR)/host-umkimage.targetinstall

host-umkimage_targetinstall_deps = $(STATEDIR)/host-umkimage.install

$(STATEDIR)/host-umkimage.targetinstall: $(host-umkimage_targetinstall_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

host-umkimage_clean:
	rm -rf $(STATEDIR)/host-umkimage.*
	rm -rf $(HOST_UMKIMAGE_DIR)

# vim: syntax=make