summaryrefslogtreecommitdiffstats
path: root/rules/oprofile.make
blob: 275648e3d69b1a9fa120bdf3c1d31edcf528e3da (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# -*-makefile-*-
# $Id$
#
# Copyright (C) 2003 by Benedikt Spranger <b.spranger@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
#
PACKAGES-$(PTXCONF_OPROFILE) += oprofile

#
# Paths and names
#
OPROFILE_VERSION	= 0.8
OPROFILE		= oprofile-$(OPROFILE_VERSION)
OPROFILE_SUFFIX		= tar.gz
OPROFILE_URL		= $(PTXCONF_SETUP_SFMIRROR)/oprofile/$(OPROFILE).$(OPROFILE_SUFFIX)
OPROFILE_SOURCE		= $(SRCDIR)/$(OPROFILE).$(OPROFILE_SUFFIX)
OPROFILE_DIR		= $(BUILDDIR)/$(OPROFILE)

-include $(call package_depfile)

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

oprofile_get: $(STATEDIR)/oprofile.get

oprofile_get_deps	=  $(OPROFILE_SOURCE)

$(STATEDIR)/oprofile.get: $(oprofile_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(OPROFILE_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(OPROFILE_URL))

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

oprofile_extract: $(STATEDIR)/oprofile.extract

oprofile_extract_deps	=  $(STATEDIR)/oprofile.get

$(STATEDIR)/oprofile.extract: $(oprofile_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(OPROFILE_DIR))
	@$(call extract, $(OPROFILE_SOURCE))
	@$(call patchin, $(OPROFILE))
	@$(call touch, $@)

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

oprofile_prepare: $(STATEDIR)/oprofile.prepare

#
# dependencies
#
oprofile_prepare_deps =  \
	$(STATEDIR)/virtual-xchain.install \
	$(STATEDIR)/popt.install \
	$(STATEDIR)/oprofile.extract

OPROFILE_PATH	=  PATH=$(CROSS_PATH)
OPROFILE_ENV 	=  $(CROSS_ENV)

#
# autoconf
#
OPROFILE_AUTOCONF	=  $(CROSS_AUTOCONF_USR)
OPROFILE_AUTOCONF	+= --with-kernel-support
#
# note: we must use here the kernel's makevars (ARCH=fo CROSS_COMPILE=bar)
#       (see kernel.make) because oprofile includes the kernel's makefile
#       in it's modules subdir, and there it doesn't care about the CC
#       we gave him at ./configure-time....
#
OPROFILE_MAKEVARS	=  $(KERNEL_MAKEVARS)

$(STATEDIR)/oprofile.prepare: $(oprofile_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(OPROFILE_DIR)/config.cache)
	cd $(OPROFILE_DIR) && \
		$(OPROFILE_PATH) $(OPROFILE_ENV) \
		./configure $(OPROFILE_AUTOCONF)
	@$(call touch, $@)

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

oprofile_compile: $(STATEDIR)/oprofile.compile

oprofile_compile_deps =  $(STATEDIR)/oprofile.prepare

$(STATEDIR)/oprofile.compile: $(oprofile_compile_deps)
	@$(call targetinfo, $@)
	$(OPROFILE_PATH) make -C $(OPROFILE_DIR) $(OPROFILE_MAKEVARS)
	@$(call touch, $@)

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

oprofile_install: $(STATEDIR)/oprofile.install

$(STATEDIR)/oprofile.install: $(STATEDIR)/oprofile.compile
	@$(call targetinfo, $@)
	@$(call install, OPROFILE)
	@$(call touch, $@)

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

oprofile_targetinstall: $(STATEDIR)/oprofile.targetinstall

oprofile_targetinstall_deps	=  $(STATEDIR)/oprofile.compile

$(STATEDIR)/oprofile.targetinstall: $(oprofile_targetinstall_deps)
	@$(call targetinfo, $@)
	# FIXME: nothing to do on targetinstall? 
	@$(call touch, $@)

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

oprofile_clean:
	rm -rf $(STATEDIR)/oprofile.*
	rm -rf $(OPROFILE_DIR)

# vim: syntax=make