1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
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. #
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. #
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 #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
21 ###############################################################################
23 ###############################################################################
25 ###############################################################################
31 THISAPP = uClibc-$(VER)
32 DL_FILE = $(THISAPP).tar.bz2
33 DL_FROM = $(URL_IPFIRE)
34 DIR_APP = $(DIR_SRC)/$(THISAPP)
36 TARGET = $(DIR_INFO)/$(THISAPP)-pass1
39 TARGET = $(DIR_INFO)/$(THISAPP)-pass2
41 TARGET = $(DIR_INFO)/$(THISAPP)-pass3
45 STAGING_DIR=/opt/$(MACHINE)-uClibc
47 ###############################################################################
49 ###############################################################################
51 objects = $(DL_FILE) buildroot-snapshot-20061026.tar.bz2 uClibc-locale-030818.tgz
53 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
54 buildroot-snapshot-20061026.tar.bz2 = $(DL_FROM)/buildroot-snapshot-20061026.tar.bz2
55 uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
57 $(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
58 buildroot-snapshot-20061026.tar.bz2_MD5 = ecc5d48a780e46a56d1d39207d5868bd
59 uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6
63 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
65 download :$(patsubst %,$(DIR_DL)/%,$(objects))
67 md5 : $(subst %,%_MD5,$(objects))
69 ###############################################################################
70 # Downloading, checking, md5sum
71 ###############################################################################
73 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
76 $(patsubst %,$(DIR_DL)/%,$(objects)) :
79 $(subst %,%_MD5,$(objects)) :
82 ###############################################################################
83 # Installation Details
84 ###############################################################################
86 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
90 @mkdir -p /opt/$(MACHINE)-uClibc $(DIR_SRC)/uClibc_dev/usr/include $(DIR_SRC)/uClibc_dev/{,usr}/lib
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 oldconfig
97 cd $(DIR_APP)/extra/locale && make
98 cd $(DIR_APP) && make PREFIX=$(DIR_SRC)/uClibc_dev \
100 RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \
104 cd $(DIR_APP) && make PREFIX= \
108 cd $(DIR_APP) && make PREFIX= \
109 DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \
110 RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \
111 install_runtime install_dev
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; \
120 cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \
122 cd $(DIR_APP) && make PREFIX=/install/initrd \
126 cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib
127 cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib
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
131 ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
133 cd $(DIR_APP) && make PREFIX=/install/initrd utils install_utils
134 chmod 755 /install/initrd/lib/libuClibc-$(VER).so
135 rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*}