summaryrefslogtreecommitdiffstats
path: root/rules/liboop.make
blob: ba96e4c313db4492e5775797505f8cb75c71743f (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
# -*-makefile-*-
# $Id: liboop.make,v 1.5 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.
#

#
# We provide this package
#
ifeq (y,$(PTXCONF_LIBOOP))
PACKAGES += liboop
endif

#
# Paths and names 
#
LIBOOP			= liboop-0.8
LIBOOP_URL 		= http://download.ofb.net/liboop/$(LIBOOP).tar.gz
LIBOOP_SOURCE		= $(SRCDIR)/$(LIBOOP).tar.gz
LIBOOP_DIR 		= $(BUILDDIR)/$(LIBOOP)
LIBOOP_EXTRACT		= gzip -dc

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

liboop_get: $(STATEDIR)/liboop.get

$(STATEDIR)/liboop.get: $(LIBOOP_SOURCE)
	@$(call targetinfo, $@)
	touch $@

$(LIBOOP_SOURCE):
	@$(call targetinfo, $@)
	wget -P $(SRCDIR) $(PASSIVEFTP) $(LIBOOP_URL)

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

liboop_extract: $(STATEDIR)/liboop.extract

LIBOOP_USE_LIBTOOLIZE = libtoolize
LIBOOP_USE_ACLOCAL    = aclocal
LIBOOP_USE_AUTOCONF   = autoconf
LIBOOP_USE_AUTOMAKE   = automake

$(STATEDIR)/liboop.extract: $(STATEDIR)/liboop.get
	@$(call targetinfo, $@)
	$(LIBOOP_EXTRACT) $(LIBOOP_SOURCE) | $(TAR) -C $(BUILDDIR) -xf -
	# 
	# we have to add a switch to disable tcl
	#
	#
	cd $(LIBOOP_DIR) && cat $(SRCDIR)/liboop-0.8-ptx1.diff | patch -p1
	rm -f $(LIBOOP_DIR)/missing
	rm -f $(LIBOOP_DIR)/libtool
	rm -f $(LIBOOP_DIR)/ltconfig
	rm -f $(LIBOOP_DIR)/ltmain.sh
	#
	cd $(LIBOOP_DIR) && $(LIBOOP_USE_LIBTOOLIZE) --force -c
	cd $(LIBOOP_DIR) && $(LIBOOP_USE_ACLOCAL)
	cd $(LIBOOP_DIR) && $(LIBOOP_USE_AUTOCONF)
	cd $(LIBOOP_DIR) && $(LIBOOP_USE_AUTOMAKE) -a
	#
	touch $@

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

liboop_prepare: $(STATEDIR)/liboop.prepare

LIBOOP_AUTOCONF =
LIBOOP_AUTOCONF += --build=$(GNU_HOST)
LIBOOP_AUTOCONF += --host=$(PTXCONF_GNU_TARGET)
LIBOOP_AUTOCONF += --prefix=$(PTXCONF_PREFIX)
LIBOOP_AUTOCONF += --without-tcl

$(STATEDIR)/liboop.prepare: $(STATEDIR)/liboop.extract
	@$(call targetinfo, $@)
	cd $(LIBOOP_DIR) &&						\
		PATH=$(PTXCONF_PREFIX)/bin:$$PATH ./configure $(LIBOOP_AUTOCONF)
	touch $@

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

liboop_compile: $(STATEDIR)/liboop.compile

$(STATEDIR)/liboop.compile: $(STATEDIR)/liboop.prepare 
	@$(call targetinfo, $@)
	PATH=$(PTXCONF_PREFIX)/bin:$$PATH make -C $(LIBOOP_DIR)
	touch $@

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

liboop_install: $(STATEDIR)/liboop.install

$(STATEDIR)/liboop.install: $(STATEDIR)/liboop.compile
	@$(call targetinfo, $@)
	# FIXME: this doesn't work when using local bin dir
	make -C $(LIBOOP_DIR) install
	touch $@

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

liboop_targetinstall: $(STATEDIR)/liboop.targetinstall

$(STATEDIR)/liboop.targetinstall: $(STATEDIR)/liboop.install
	@$(call targetinfo, $@)
	# FIXME: the other liboop libraries should optionally be installed 
	# we want to preserve links, so we cannot use install
	cp -d $(PTXCONF_PREFIX)/lib/liboop.so* $(ROOTDIR)/lib/
	$(CROSSSTRIP) -S $(ROOTDIR)/lib/liboop.so*
	touch $@

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

liboop_clean: 
	rm -rf $(STATEDIR)/liboop.* $(LIBOOP_DIR)

# vim: syntax=make