summaryrefslogtreecommitdiffstats
path: root/rules/xchain-umkimage.make
blob: d2f823e7fa3892e40a0d8a9510999837027b6590 (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
124
# -*-makefile-*-
# $Id: xchain-umkimage.make,v 1.5 2004/06/22 06:53:53 rsc Exp $
#
# 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
#
ifdef PTXCONF_XCHAIN_UMKIMAGE
PACKAGES += xchain-umkimage
endif

#
# Paths and names
#
XCHAIN_UMKIMAGE_VERSION	= 20030424
XCHAIN_UMKIMAGE		= u-boot-mkimage-$(XCHAIN_UMKIMAGE_VERSION)
XCHAIN_UMKIMAGE_SUFFIX	= tar.gz
XCHAIN_UMKIMAGE_URL	= http://www.pengutronix.de/software/ptxdist/temporary-src/$(XCHAIN_UMKIMAGE).$(XCHAIN_UMKIMAGE_SUFFIX)
XCHAIN_UMKIMAGE_SOURCE	= $(SRCDIR)/$(XCHAIN_UMKIMAGE).$(XCHAIN_UMKIMAGE_SUFFIX)
XCHAIN_UMKIMAGE_DIR	= $(BUILDDIR)/$(XCHAIN_UMKIMAGE)

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

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

xchain-umkimage_get_deps = $(XCHAIN_UMKIMAGE_SOURCE)

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

$(XCHAIN_UMKIMAGE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(XCHAIN_UMKIMAGE_URL))

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

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

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

$(STATEDIR)/xchain-umkimage.extract: $(xchain-umkimage_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(XCHAIN_UMKIMAGE_DIR))
	@$(call extract, $(XCHAIN_UMKIMAGE_SOURCE))
	touch $@

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

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

#
# dependencies
#
xchain-umkimage_prepare_deps = \
	$(STATEDIR)/xchain-umkimage.extract \
	$(STATEDIR)/xchain-zlib.install

XCHAIN_UMKIMAGE_MAKEVARS	= CC=$(HOSTCC)
XCHAIN_UMKIMAGE_ENV		= CFLAGS=-I$(PTXCONF_PREFIX)/include

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

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

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

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

$(STATEDIR)/xchain-umkimage.compile: $(xchain-umkimage_compile_deps)
	@$(call targetinfo, $@)
	$(XCHAIN_UMKIMAGE_ENV) make -C $(XCHAIN_UMKIMAGE_DIR) $(XCHAIN_UMKIMAGE_MAKEVARS)
	touch $@

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

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

$(STATEDIR)/xchain-umkimage.install: $(STATEDIR)/xchain-umkimage.compile
	@$(call targetinfo, $@)
	mkdir -p $(PTXCONF_PREFIX)/bin
	install $(XCHAIN_UMKIMAGE_DIR)/mkimage $(PTXCONF_PREFIX)/bin/u-boot-mkimage
	touch $@

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

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

xchain-umkimage_targetinstall_deps = $(STATEDIR)/xchain-umkimage.compile

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

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

xchain-umkimage_clean:
	rm -rf $(STATEDIR)/xchain-umkimage.*
	rm -rf $(XCHAIN_UMKIMAGE_DIR)

# vim: syntax=make