summaryrefslogtreecommitdiffstats
path: root/rules/ltt.make
blob: af6b343886a85fd7f50dab73dc79002544a3693b (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
144
145
146
# -*-makefile-*-
# $Id: ltt.make,v 1.3 2003/09/19 13:43:36 mkl Exp $
#
# (c) 2003 by Auerswald GmbH & Co. KG, Schandelah, Germany
# (c) 2003 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.
#

#
# We provide this package
#
ifeq (y, $(PTXCONF_LTT))
PACKAGES += ltt
endif

#
# Paths and names 
#
LTT_VERSION		= 0.9.5
LTT			= TraceToolkit-$(LTT_VERSION)
LTT_SUFFIX		= tgz
# FIXME: beat upstream for "a" syntax...
LTT_URL			= http://www.opersys.com/ftp/pub/LTT/$(LTT)a.$(LTT_SUFFIX)
LTT_SOURCE		= $(SRCDIR)/$(LTT)a.$(LTT_SUFFIX)
LTT_DIR			= $(BUILDDIR)/$(LTT)

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

ltt_get: $(STATEDIR)/ltt.get

ltt_get_deps = $(LTT_SOURCE)

$(STATEDIR)/ltt.get: $(ltt_get_deps)
	@$(call targetinfo, ltt.get)
	@$(call get_patches, $(LTT))
	touch $@

$(LTT_SOURCE):
	@$(call targetinfo, ltt.get)
	@$(call get, $(LTT_URL))

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

ltt_extract: $(STATEDIR)/ltt.extract

ltt_extract_deps =  $(STATEDIR)/ltt.get

$(STATEDIR)/ltt.extract: $(ltt_extract_deps)
	@$(call targetinfo, ltt.extract)
	@$(call clean, $(LTT_DIR))
	@$(call extract, $(LTT_SOURCE))
	@$(call patchin, $(LTT))
	touch $@

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

ltt_prepare: $(STATEDIR)/ltt.prepare

LTT_PATH	=  PATH=$(PTXCONF_PREFIX)/$(AUTOCONF213)/bin:$(CROSS_PATH)
LTT_ENV		=  $(CROSS_ENV)
LTT_ENV		+= ac_cv_func_setvbuf_reversed=no ltt_cv_have_mbstate_t=yes

LTT_AUTOCONF	= --disable-sanity-checks
LTT_AUTOCONF	+= --prefix=$(PTXCONF_PREFIX)

#
# dependencies
#
ltt_prepare_deps =  $(STATEDIR)/ltt.extract 
ltt_prepare_deps += $(STATEDIR)/virtual-xchain.install

$(STATEDIR)/ltt.prepare: $(ltt_prepare_deps)
	@$(call targetinfo, ltt.prepare)

	# configure without $(LTT_ENV) now, add this later;
	# visualizer has to be built for host...
	cd $(LTT_DIR) &&					\
		$(LTT_PATH)					\
		./configure $(LTT_AUTOCONF)
	touch $@

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

ltt_compile: $(STATEDIR)/ltt.compile

ltt_compile_deps = $(STATEDIR)/ltt.prepare

$(STATEDIR)/ltt.compile: $(STATEDIR)/ltt.prepare 
	@$(call targetinfo, ltt.compile)

#	build for target:
	make -C $(LTT_DIR)/LibUserTrace $(LTT_ENV) UserTrace.o
	make -C $(LTT_DIR)/LibUserTrace $(LTT_ENV) LDFLAGS="-static"
	make -C $(LTT_DIR)/Daemon $(LTT_ENV) LDFLAGS="-static"

#	build for host:
	make -C $(LTT_DIR)/LibLTT
	make -C $(LTT_DIR)/Visualizer

	touch $@

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

ltt_install: $(STATEDIR)/ltt.install

$(STATEDIR)/ltt.install: $(STATEDIR)/ltt.compile
	@$(call targetinfo, ltt.install)
	make -C $(LTT_DIR)/LibLTT install
	make -C $(LTT_DIR)/Visualizer install
	touch $@

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

ltt_targetinstall: $(STATEDIR)/ltt.targetinstall

$(STATEDIR)/ltt.targetinstall: $(STATEDIR)/ltt.install
	@$(call targetinfo, ltt.targetinstall)
	$(CROSSSTRIP) $(LTT_DIR)/Daemon/tracedaemon
	cp $(LTT_DIR)/Daemon/tracedaemon $(ROOTDIR)/usr/sbin
	cp $(LTT_DIR)/createdev.sh $(ROOTDIR)/usr/sbin/tracecreatedev
	cp $(LTT_DIR)/Daemon/Scripts/trace* $(ROOTDIR)/usr/sbin
	touch $@

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

ltt_clean: 
	rm -rf $(STATEDIR)/ltt.* $(LTT_DIR)

# vim: syntax=make