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
|
# -*-makefile-*-
# $Id$
#
# 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
#
PACKAGES-$(PTXCONF_ZLIB) += zlib
#
# Paths and names
#
ZLIB_VERSION = 1.2.3
ZLIB = zlib-$(ZLIB_VERSION)
ZLIB_URL = http://www.zlib.net/$(ZLIB).tar.gz
ZLIB_SOURCE = $(SRCDIR)/$(ZLIB).tar.gz
ZLIB_DIR = $(BUILDDIR)/$(ZLIB)
-include $(call package_depfile)
# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------
zlib_get: $(STATEDIR)/zlib.get
$(STATEDIR)/zlib.get: $(ZLIB_SOURCE)
@$(call targetinfo, $@)
@$(call touch, $@)
$(ZLIB_SOURCE):
@$(call targetinfo, $@)
@$(call get, $(ZLIB_URL))
# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------
zlib_extract: $(STATEDIR)/zlib.extract
$(STATEDIR)/zlib.extract: $(zlib_extract_deps_default)
@$(call targetinfo, $@)
@$(call clean, $(ZLIB_DIR))
@$(call extract, $(ZLIB_SOURCE))
@$(call touch, $@)
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
zlib_prepare: $(STATEDIR)/zlib.prepare
ZLIB_PATH = PATH=$(CROSS_PATH)
ZLIB_ENV = $(subst CFLAGS,SGALFC,$(CROSS_ENV)) AR="$(CROSS_AR) rc"
ZLIB_AUTOCONF = --shared --prefix=$(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)
$(STATEDIR)/zlib.prepare: $(zlib_prepare_deps_default)
@$(call targetinfo, $@)
cd $(ZLIB_DIR) && $(ZLIB_ENV) $(ZLIB_PATH) ./configure $(ZLIB_AUTOCONF)
@$(call touch, $@)
# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------
zlib_compile: $(STATEDIR)/zlib.compile
$(STATEDIR)/zlib.compile: $(zlib_compile_deps_default)
@$(call targetinfo, $@)
$(ZLIB_ENV) $(ZLIB_PATH) cd $(ZLIB_DIR) && make
$(ZLIB_ENV) $(ZLIB_PATH) cd $(ZLIB_DIR) && make libz.a
@$(call touch, $@)
# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------
zlib_install: $(STATEDIR)/zlib.install
$(STATEDIR)/zlib.install: $(zlib_install_deps_default)
@$(call targetinfo, $@)
install -d $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/include
cd $(ZLIB_DIR) && $(ZLIB_PATH) $(MAKE_INSTALL)
cp $(ZLIB_DIR)/libz.a $(PTXCONF_PREFIX)/$(PTXCONF_GNU_TARGET)/lib/
@$(call touch, $@)
# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
zlib_targetinstall: $(STATEDIR)/zlib.targetinstall
$(STATEDIR)/zlib.targetinstall: $(zlib_targetinstall_deps_default)
@$(call targetinfo, $@)
@$(call install_init,default)
@$(call install_fixup,PACKAGE,zlib)
@$(call install_fixup,PRIORITY,optional)
@$(call install_fixup,VERSION,$(ZLIB_VERSION))
@$(call install_fixup,SECTION,base)
@$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
@$(call install_fixup,DEPENDS,)
@$(call install_fixup,DESCRIPTION,missing)
@$(call install_copy, 0, 0, 0644, $(ZLIB_DIR)/libz.so.1.2.3, /usr/lib/libz.so.1.2.3)
@$(call install_link, libz.so.1.2.3, /usr/lib/libz.so.1)
@$(call install_link, libz.so.1.2.3, /usr/lib/libz.so)
@$(call install_finish)
@$(call touch, $@)
# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------
zlib_clean:
rm -rf $(STATEDIR)/zlib.*
rm -rf $(IMAGEDIR)/zlib_*
rm -rf $(ZLIB_DIR)
# vim: syntax=make
|