summaryrefslogtreecommitdiffstats
path: root/rules/mingw-runtime.make
blob: 2b590ece3eba36204886a376c263ba66e7d00390 (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
# -*-makefile-*-
#
# 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
#
PACKAGES-$(PTXCONF_MINGW_RUNTIME) += mingw-runtime

#
# Paths and names
#
MINGW_RUNTIME_VERSION	:= $(call remove_quotes,$(PTXCONF_MINGW_RUNTIME_VERSION))
MINGW_RUNTIME_MD5	:= $(call remove_quotes,$(PTXCONF_MINGW_RUNTIME_MD5))
MINGW_RUNTIME		:= mingwrt-$(MINGW_RUNTIME_VERSION)-mingw32
MINGW_RUNTIME_SUFFIX	:= tar.gz
MINGW_RUNTIME_URL	:= $(PTXCONF_SETUP_SFMIRROR)/mingw/$(MINGW_RUNTIME)-src.$(MINGW_RUNTIME_SUFFIX)
MINGW_RUNTIME_SOURCE	:= $(SRCDIR)/$(MINGW_RUNTIME)-src.$(MINGW_RUNTIME_SUFFIX)
MINGW_RUNTIME_DIR	:= $(BUILDDIR)/$(MINGW_RUNTIME)
MINGW_RUNTIME_BUILDDIR	:= $(BUILDDIR)/$(MINGW_RUNTIME)-build

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

$(MINGW_RUNTIME_SOURCE):
	@$(call targetinfo)
	@$(call get, MINGW_RUNTIME)

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

$(STATEDIR)/mingw-runtime.extract:
	@$(call targetinfo)
	@$(call clean, $(MINGW_RUNTIME_DIR))
	@$(call extract, MINGW_RUNTIME)
	@$(call patchin, MINGW_RUNTIME, $(MINGW_RUNTIME_DIR))
	@$(call touch)

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

MINGW_RUNTIME_PATH := PATH=$(CROSS_PATH)
MINGW_RUNTIME_ENV := $(CROSS_ENV)

MINGW_RUNTIME_AUTOCONF := \
	--prefix=$(SYSROOT)/mingw \
	--host=$(PTXCONF_GNU_TARGET) \
	--target=$(PTXCONF_GNU_TARGET)

$(STATEDIR)/mingw-runtime.prepare:
	@$(call targetinfo)
	@$(call clean, $(MINGW_RUNTIME_BUILDDIR))
	mkdir -p $(MINGW_RUNTIME_BUILDDIR)
	cd $(MINGW_RUNTIME_BUILDDIR) && $(MINGW_RUNTIME_ENV) $(MINGW_RUNTIME_PATH) \
		$(MINGW_RUNTIME_DIR)/configure $(MINGW_RUNTIME_AUTOCONF)
	@$(call touch)

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

$(STATEDIR)/mingw-runtime.compile:
	@$(call targetinfo)
	cd $(MINGW_RUNTIME_BUILDDIR) && $(MINGW_RUNTIME_PATH) \
		$(MAKE) $(PARALLELMFLAGS) W32API_INCLUDE=-I$(SYSROOT)/mingw/include
	@$(call touch)

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

$(STATEDIR)/mingw-runtime.install:
	@$(call targetinfo)
	cd $(MINGW_RUNTIME_BUILDDIR) && \
		$(MINGW_RUNTIME_PATH) $(MAKE) \
		install_root=$(SYSROOT) install
	@$(call touch)

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

$(STATEDIR)/mingw-runtime.targetinstall:
	@$(call targetinfo)
	@$(call touch)

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

mingw-runtime_clean:
	rm -rf $(STATEDIR)/mingw-runtime.*
	rm -rf $(MINGW_RUNTIME_DIR)

# vim: syntax=make