summaryrefslogtreecommitdiffstats
path: root/rules/gmp3.make
blob: e57d80300181cefa0f76a34d83935a91f11aa053 (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
# -*-makefile-*-
# $Id: gmp3.make,v 1.3 2003/10/23 15:01:19 mkl Exp $
#
# Copyright (C) 2002 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.
#

#
# Paths and names 
#
GMP3_VERSION	= 3.1.1
GMP3		= gmp-$(GMP3_VERSION)
GMP3_SUFFIX	= tar.gz
GMP3_URL	= ftp://ftp.gnu.org/gnu/gmp/$(GMP3).$(GMP3_SUFFIX)
GMP3_SOURCE	= $(SRCDIR)/$(GMP3).$(GMP3_SUFFIX)
GMP3_DIR 	= $(BUILDDIR)/$(GMP3)
GMP3_EXTRACT	= gzip -dc

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

gmp3_get: $(STATEDIR)/gmp3.get

$(STATEDIR)/gmp3.get: $(GMP3_SOURCE)
	@$(call targetinfo, $@)
	touch $@

$(GMP3_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(GMP3_URL))

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

gmp3_extract: $(STATEDIR)/gmp3.extract

$(STATEDIR)/gmp3.extract: $(STATEDIR)/gmp3.get
	@$(call targetinfo, $@)
	@$(call clean, $(GMP3_DIR))
	@$(call extract, $(GMP3_SOURCE))
	touch $@

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

gmp3_prepare: $(STATEDIR)/gmp3.prepare

gmp3_prepare_deps = \
	$(STATEDIR)/virtual-xchain.install \
	$(STATEDIR)/gmp3.extract

GMP3_PATH	= PATH=$(CROSS_PATH)
GMP3_ENV	= $(CROSS_ENV)

GMP3_AUTOCONF	=
GMP3_AUTOCONF	+= --build=$(GNU_HOST)
GMP3_AUTOCONF	+= --host=$(PTXCONF_GNU_TARGET)
GMP3_AUTOCONF	+= --prefix=$(CROSS_LIB_DIR)

$(STATEDIR)/gmp3.prepare: $(gmp3_prepare_deps)
	@$(call targetinfo, $@)
	cd $(GMP3_DIR) && \
		$(GMP3_PATH) $(GMP3_ENV) ./configure $(GMP3_AUTOCONF)
	touch $@

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

gmp3_compile: $(STATEDIR)/gmp3.compile

$(STATEDIR)/gmp3.compile: $(STATEDIR)/gmp3.prepare 
	@$(call targetinfo, $@)
	$(GMP3_PATH) make -C $(GMP3_DIR)
	touch $@

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

gmp3_install: $(STATEDIR)/gmp3.install

$(STATEDIR)/gmp3.install: $(STATEDIR)/gmp3.compile
	@$(call targetinfo, $@)
	$(GMP3_PATH) make -C $(GMP3_DIR) install 
	touch $@

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

gmp3_targetinstall: $(STATEDIR)/gmp3.targetinstall

$(STATEDIR)/gmp3.targetinstall: $(STATEDIR)/gmp3.install
	@$(call targetinfo, $@)
	mkdir -p $(ROOTDIR)/lib
	cp -a $(CROSS_LIB_DIR)/lib/libgmp.so* $(ROOTDIR)/lib
	$(CROSSSTRIP) -S -R .note -R .comment $(ROOTDIR)/lib/libgmp.so*
	touch $@

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

gmp3_clean: 
	rm -rf $(STATEDIR)/gmp3.* 
	rm -rf $(GMP3_DIR)

# vim: syntax=make