Installer-Toolchain nochmals ueberarbeitet.
[people/teissler/ipfire-2.x.git] / lfs / uClibc
CommitLineData
cd1a2927
MT
1###############################################################################
2# This file is part of the IPCop Firewall. #
3# #
4# IPCop is free software; you can redistribute it and/or modify #
5# it under the terms of the GNU General Public License as published by #
6# the Free Software Foundation; either version 2 of the License, or #
7# (at your option) any later version. #
8# #
9# IPCop is distributed in the hope that it will be useful, #
10# but WITHOUT ANY WARRANTY; without even the implied warranty of #
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12# GNU General Public License for more details. #
13# #
14# You should have received a copy of the GNU General Public License #
15# along with IPCop; if not, write to the Free Software #
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
17# #
18# Makefiles are based on LFSMake, which is #
19# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
20# #
cd1a2927
MT
21###############################################################################
22
23###############################################################################
24# Definitions
25###############################################################################
26
27include Config
28
1d4ec104 29VER = 0.9.28
cd1a2927
MT
30
31THISAPP = uClibc-$(VER)
1d4ec104 32DL_FILE = $(THISAPP).tar.bz2
45405baa 33DL_FROM = $(URL_IPFIRE)
cd1a2927 34DIR_APP = $(DIR_SRC)/$(THISAPP)
bc9f0c12
MT
35ifeq "$(PASS)" "1"
36 TARGET = $(DIR_INFO)/$(THISAPP)-pass1
37else
38ifeq "$(PASS)" "2"
39 TARGET = $(DIR_INFO)/$(THISAPP)-pass2
40else
41 TARGET = $(DIR_INFO)/$(THISAPP)-pass3
42endif
43endif
44
45STAGING_DIR=/opt/$(MACHINE)-uClibc
cd1a2927
MT
46
47###############################################################################
48# Top-level Rules
49###############################################################################
50
72d80898 51objects = $(DL_FILE) buildroot-snapshot-20061026.tar.bz2 uClibc-locale-030818.tgz
cd1a2927 52
a50d04ab
MT
53$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
54buildroot-snapshot-20061026.tar.bz2 = $(DL_FROM)/buildroot-snapshot-20061026.tar.bz2
55uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
cd1a2927 56
a50d04ab
MT
57$(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
58buildroot-snapshot-20061026.tar.bz2_MD5 = ecc5d48a780e46a56d1d39207d5868bd
59uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6
cd1a2927
MT
60
61install : $(TARGET)
62
63check : $(patsubst %,$(DIR_CHK)/%,$(objects))
64
65download :$(patsubst %,$(DIR_DL)/%,$(objects))
66
67md5 : $(subst %,%_MD5,$(objects))
68
69###############################################################################
70# Downloading, checking, md5sum
71###############################################################################
72
73$(patsubst %,$(DIR_CHK)/%,$(objects)) :
74 @$(CHECK)
75
76$(patsubst %,$(DIR_DL)/%,$(objects)) :
77 @$(LOAD)
78
79$(subst %,%_MD5,$(objects)) :
80 @$(MD5)
81
82###############################################################################
83# Installation Details
84###############################################################################
85
86$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
87 @$(PREBUILD)
bc9f0c12
MT
88ifeq "$(PASS)" "1"
89 @rm -rf $(DIR_APP)
a50d04ab 90 @mkdir -p /opt/$(MACHINE)-uClibc $(DIR_SRC)/uClibc_dev/usr/include $(DIR_SRC)/uClibc_dev/{,usr}/lib
bc9f0c12
MT
91 @cd $(DIR_SRC) && tar xfj $(DIR_DL)/$(DL_FILE)
92 cp -f $(DIR_DL)/uClibc-locale-030818.tgz $(DIR_APP)/extra/locale/
93 cp -f $(DIR_SRC)/config/uClibc/{locales,codesets}.txt $(DIR_APP)/extra/locale
94 cd $(DIR_APP)/extra/locale && patch -Np3 < $(DIR_SRC)/src/patches/uClibc-gcc4-genwctype.patch
95 cp -f $(DIR_SRC)/config/uClibc/uClibc.config-$(MACHINE) $(DIR_APP)/.config
a50d04ab
MT
96 cd $(DIR_APP) && make oldconfig
97 cd $(DIR_APP)/extra/locale && make
98 cd $(DIR_APP) && make PREFIX=$(DIR_SRC)/uClibc_dev \
99 DEVEL_PREFIX=/usr/ \
100 RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \
101 pregen install_dev
bc9f0c12
MT
102else
103ifeq "$(PASS)" "2"
a50d04ab
MT
104 cd $(DIR_APP) && make PREFIX= \
105 DEVEL_PREFIX=/ \
106 RUNTIME_PREFIX=/ \
107 all
108 cd $(DIR_APP) && make PREFIX= \
109 DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \
110 RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \
111 install_runtime install_dev
112
113 ## This is to fix a small bug
114 if [ ! -h /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib ]; then \
115 mv -vf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib/* /opt/$(MACHINE)-uClibc/lib/; \
116 rm -rf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
117 ln -sfv ../lib /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
118 fi
119
120 cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \
121 hostutils
122 cd $(DIR_APP) && make PREFIX=/install/initrd \
123 DEVEL_PREFIX=/usr/ \
124 RUNTIME_PREFIX=/ \
125 install_runtime
1d4ec104
MT
126 cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib
127 cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib
1d4ec104
MT
128 cd /lib && ln -sf ld-uClibc-$(VER).so ld-uClibc.so.0
129 cd /lib && ln -sf libuClibc-$(VER).so libc.so.0
130 cd /lib && ln -sf libc.so.0 libc.so
bc9f0c12
MT
131 ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
132else
a50d04ab 133 cd $(DIR_APP) && make PREFIX=/install/initrd utils install_utils
bc9f0c12
MT
134 chmod 755 /install/initrd/lib/libuClibc-$(VER).so
135 rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*}
136 @rm -rf $(DIR_APP)
137endif
138endif
cd1a2927 139 @$(POSTBUILD)