summaryrefslogtreecommitdiffstats
path: root/rules/cross-gdb.make
blob: 6d8571d51dbc3f4a7b58b0b2f6063548d791a9a8 (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
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2006 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
#
CROSS_PACKAGES-$(PTXCONF_CROSS_GDB) += cross-gdb

#
# Paths and names
#
CROSS_GDB_VERSION	= $(GDB_VERSION)
CROSS_GDB		= $(GDB)
CROSS_GDB_SUFFIX	= $(GDB_SUFFIX)
CROSS_GDB_URL		= $(GDB_URL)
CROSS_GDB_SOURCE	= $(GDB_SOURCE)
CROSS_GDB_DIR		= $(CROSS_BUILDDIR)/$(CROSS_GDB)

-include $(call package_depfile)

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

cross-gdb_get: $(STATEDIR)/cross-gdb.get

$(STATEDIR)/cross-gdb.get: $(cross-gdb_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

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

cross-gdb_extract: $(STATEDIR)/cross-gdb.extract

$(STATEDIR)/cross-gdb.extract: $(cross-gdb_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(CROSS_GDB_DIR))
	@$(call extract, $(CROSS_GDB_SOURCE), $(CROSS_BUILDDIR))
	@$(call patchin, $(CROSS_GDB), $(CROSS_GDB_DIR))
	@$(call touch, $@)

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

cross-gdb_prepare: $(STATEDIR)/cross-gdb.prepare

CROSS_GDB_PATH	=  PATH=$(CROSS_PATH)
CROSS_GDB_ENV 	=  $(HOSTCC_ENV)

#
# autoconf
#
CROSS_GDB_AUTOCONF =  --prefix=$(PTXCONF_PREFIX)
CROSS_GDB_AUTOCONF += --build=$(GNU_HOST)
CROSS_GDB_AUTOCONF += --host=$(GNU_HOST)
CROSS_GDB_AUTOCONF += --target=$(PTXCONF_GNU_TARGET)

$(STATEDIR)/cross-gdb.prepare: $(cross-gdb_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(CROSS_GDB_DIR)/config.cache)
	cd $(CROSS_GDB_DIR) && \
		$(CROSS_GDB_PATH) $(CROSS_GDB_ENV) \
		./configure $(CROSS_GDB_AUTOCONF)
	@$(call touch, $@)

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

cross-gdb_compile: $(STATEDIR)/cross-gdb.compile

$(STATEDIR)/cross-gdb.compile: $(cross-gdb_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(CROSS_GDB_DIR) && $(CROSS_GDB_ENV) $(CROSS_GDB_PATH) make
	@$(call touch, $@)

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

cross-gdb_install: $(STATEDIR)/cross-gdb.install

$(STATEDIR)/cross-gdb.install: $(cross-gdb_install_deps_default)
	@$(call targetinfo, $@)
	@$(call install, CROSS_GDB,,h)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Targetinstall
# ----------------------------------------------------------------------------

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

cross-gdb_clean:
	rm -rf $(STATEDIR)/cross-gdb.*
	rm -rf $(CROSS_GDB_DIR)

# vim: syntax=make