]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/uClibc
Ich hab mal ueber die Feiertage nen kleinen Rewrite von dem Installersystem gemacht.
[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
41921bd9
MT
53$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
54buildroot-snapshot-20061026.tar.bz2 = $(DL_FROM)/buildroot-snapshot-20061026.tar.bz2
72d80898 55uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
cd1a2927 56
41921bd9
MT
57$(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
58buildroot-snapshot-20061026.tar.bz2_MD5 = ecc5d48a780e46a56d1d39207d5868bd
72d80898 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)
90 @mkdir -p /opt/$(MACHINE)-uClibc
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
96 cd $(DIR_APP) && make CROSS= PREFIX=$(STAGING_DIR) oldconfig
97 cd $(DIR_APP) && make CROSS= PREFIX=$(STAGING_DIR) pregen headers install_dev
98# cd $(DIR_APP)/extra/locale && make
99else
100ifeq "$(PASS)" "2"
101 cd $(DIR_APP) && CROSS=$(MACHINE)-linux-uclibc- PREFIX=/opt/$(MACHINE)-uClibc make all install
1d4ec104
MT
102 cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib
103 cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib
1d4ec104
MT
104 cd /lib && ln -sf ld-uClibc-$(VER).so ld-uClibc.so.0
105 cd /lib && ln -sf libuClibc-$(VER).so libc.so.0
106 cd /lib && ln -sf libc.so.0 libc.so
bc9f0c12
MT
107 ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
108else
109 cd /opt/$(MACHINE)-uClibc/bin && for i in `ls -w1 $(MACHINE)-linux-uclibc-*`; do \
110 ln -sf $$i $(MACHINE)-linux-`echo $$i | cut -c 19-`; \
111 done
112 ln -sf $(MACHINE)-linux-uclibc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux
113 ln -sf gcc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/bin/cc
114 cd $(DIR_APP) && make RUNTIME_PREFIX=/install/initrd/ install_runtime
115 chmod 755 /install/initrd/lib/libuClibc-$(VER).so
116 rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*}
117 @rm -rf $(DIR_APP)
118endif
119endif
cd1a2927 120 @$(POSTBUILD)