Updated usb-modeswitch (1.1.3).
[people/pmueller/ipfire-2.x.git] / lfs / uClibc
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5 # #
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. #
10 # #
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. #
15 # #
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/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 0.9.28
28
29 THISAPP = uClibc-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33 ifeq "$(PASS)" "1"
34 TARGET = $(DIR_INFO)/$(THISAPP)-pass1
35 else
36 ifeq "$(PASS)" "2"
37 TARGET = $(DIR_INFO)/$(THISAPP)-pass2
38 else
39 TARGET = $(DIR_INFO)/$(THISAPP)-pass3
40 endif
41 endif
42
43 STAGING_DIR=/opt/$(MACHINE)-uClibc
44
45 ###############################################################################
46 # Top-level Rules
47 ###############################################################################
48
49 objects = $(DL_FILE) uClibc-locale-030818.tgz
50
51 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
52 uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
53
54 $(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
55 uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6
56
57 install : $(TARGET)
58
59 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
60
61 download :$(patsubst %,$(DIR_DL)/%,$(objects))
62
63 md5 : $(subst %,%_MD5,$(objects))
64
65 ###############################################################################
66 # Downloading, checking, md5sum
67 ###############################################################################
68
69 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
70 @$(CHECK)
71
72 $(patsubst %,$(DIR_DL)/%,$(objects)) :
73 @$(LOAD)
74
75 $(subst %,%_MD5,$(objects)) :
76 @$(MD5)
77
78 ###############################################################################
79 # Installation Details
80 ###############################################################################
81
82 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
83 @$(PREBUILD)
84 ifeq "$(PASS)" "1"
85 @rm -rf $(DIR_APP)
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 \
95 DEVEL_PREFIX=/usr/ \
96 RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \
97 pregen install_dev
98 else
99 ifeq "$(PASS)" "2"
100 cd $(DIR_APP) && make PREFIX= \
101 DEVEL_PREFIX=/ \
102 RUNTIME_PREFIX=/ \
103 all
104 cd $(DIR_APP) && make PREFIX= \
105 DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \
106 RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \
107 install_runtime install_dev
108
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; \
114 fi
115
116 cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \
117 hostutils
118 cd $(DIR_APP) && make PREFIX=/install/initrd \
119 DEVEL_PREFIX=/usr/ \
120 RUNTIME_PREFIX=/ \
121 install_runtime
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
128 else
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*}
132 @rm -rf $(DIR_APP)
133 endif
134 endif
135 @$(POSTBUILD)