1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
29 THISAPP = uClibc-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 TARGET = $(DIR_INFO)/$(THISAPP)-pass1
37 TARGET = $(DIR_INFO)/$(THISAPP)-pass2
39 TARGET = $(DIR_INFO)/$(THISAPP)-pass3
43 STAGING_DIR=/opt/$(MACHINE)-uClibc
45 ###############################################################################
47 ###############################################################################
49 objects = $(DL_FILE) uClibc-locale-030818.tgz
51 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
52 uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
54 $(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
55 uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6
59 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
61 download :$(patsubst %,$(DIR_DL)/%,$(objects))
63 md5 : $(subst %,%_MD5,$(objects))
65 ###############################################################################
66 # Downloading, checking, md5sum
67 ###############################################################################
69 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
72 $(patsubst %,$(DIR_DL)/%,$(objects)) :
75 $(subst %,%_MD5,$(objects)) :
78 ###############################################################################
79 # Installation Details
80 ###############################################################################
82 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
86 @mkdir -p /opt/$(MACHINE)-uClibc $(DIR_SRC)/uClibc_dev/usr/include $(DIR_SRC)/uClibc_dev/{,usr}/lib
87 @cd $(DIR_SRC) && tar xfj $(DIR_DL)/$(DL_FILE)
88 cp -f $(DIR_DL)/uClibc-locale-030818.tgz $(DIR_APP)/extra/locale/
89 cp -f $(DIR_SRC)/config/uClibc/{locales,codesets}.txt $(DIR_APP)/extra/locale
90 cd $(DIR_APP)/extra/locale && patch -Np3 < $(DIR_SRC)/src/patches/uClibc-gcc4-genwctype.patch
91 cp -f $(DIR_SRC)/config/uClibc/uClibc.config-$(MACHINE) $(DIR_APP)/.config
92 cd $(DIR_APP) && make oldconfig
93 cd $(DIR_APP)/extra/locale && make
94 cd $(DIR_APP) && make PREFIX=$(DIR_SRC)/uClibc_dev \
96 RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \
100 cd $(DIR_APP) && make PREFIX= \
104 cd $(DIR_APP) && make PREFIX= \
105 DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \
106 RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \
107 install_runtime install_dev
109 ## This is to fix a small bug
110 if [ ! -h /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib ]; then \
111 mv -vf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib/* /opt/$(MACHINE)-uClibc/lib/; \
112 rm -rf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
113 ln -sfv ../lib /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
116 cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \
118 cd $(DIR_APP) && make PREFIX=/install/initrd \
122 cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib
123 cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib
124 cd /lib && ln -sf ld-uClibc-$(VER).so ld-uClibc.so.0
125 cd /lib && ln -sf libuClibc-$(VER).so libc.so.0
126 cd /lib && ln -sf libc.so.0 libc.so
127 ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
129 cd $(DIR_APP) && make PREFIX=/install/initrd utils install_utils
130 chmod 755 /install/initrd/lib/libuClibc-$(VER).so
131 rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*}