summaryrefslogtreecommitdiffstats
path: root/rules/cross-ecj.make
blob: 1977a74597af9a775c74812692f78e688cf698f6 (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
# -*-makefile-*-
#
# Copyright (C) 2008 by Marc Kleine-Budde <mkl@pengutronix.de>
#
# 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
#
CROSS_PACKAGES-$(PTXCONF_CROSS_ECJ) += cross-ecj

#
# gcj or <host>-gcj is mandatory
#
ifeq ($(PTXCONF_CROSS_ECJ)-$(shell which gcj 2>/dev/null)-$(shell which $(GNU_BUILD)-gcj 2>/dev/null),y--)
    $(warning *** gcj is mandatory to build a java cross compiler)
    $(warning *** please install gcj)
    $(error )
endif

#
# Paths and names
#
CROSS_ECJ_VERSION	:= $(call remove_quotes,$(PTXCONF_CROSS_ECJ_VERSION))
CROSS_ECJ_MD5		:= $(call remove_quotes,$(PTXCONF_CROSS_ECJ_MD5))
CROSS_ECJ		:= ecj-$(CROSS_ECJ_VERSION)
CROSS_ECJ_SUFFIX	:= jar
CROSS_ECJ_URL		:= ftp://sourceware.org/pub/java/$(CROSS_ECJ).$(CROSS_ECJ_SUFFIX)
CROSS_ECJ_SOURCE	:= $(SRCDIR)/$(CROSS_ECJ).$(CROSS_ECJ_SUFFIX)
CROSS_ECJ_DIR		:= $(CROSS_BUILDDIR)/$(CROSS_ECJ)

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

ifdef PTXCONF_CROSS_ECJ
$(STATEDIR)/cross-gcc.extract: $(STATEDIR)/cross-ecj.get
endif

$(CROSS_ECJ_SOURCE):
	@$(call targetinfo)
	@$(call get, CROSS_ECJ)

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

$(STATEDIR)/cross-ecj.extract:
	@$(call targetinfo)
	@$(call touch)

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

$(STATEDIR)/cross-ecj.prepare:
	@$(call targetinfo)
	@$(call touch)

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

$(STATEDIR)/cross-ecj.compile:
	@$(call targetinfo)
	@$(call touch)

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

$(STATEDIR)/cross-ecj.install:
	@$(call targetinfo)
	if [ \! -x "$$(which $(GNU_BUILD)-gcj)" ]; then \
		ln -sf $$(which gcj) $(PTXCONF_SYSROOT_HOST)/bin/$(GNU_BUILD)-gcj; \
	fi
	@$(call touch)

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

cross-ecj_clean:
	rm -rf $(STATEDIR)/cross-ecj.*
	rm -rf $(CROSS_ECJ_DIR)

# vim: syntax=make