]>
Commit | Line | Data |
---|---|---|
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 | # # | |
21 | ############################################################################### | |
22 | ||
23 | ############################################################################### | |
24 | # Definitions | |
25 | ############################################################################### | |
26 | ||
27 | include Config | |
28 | ||
29 | VER = 0.9.28 | |
30 | ||
31 | THISAPP = uClibc-$(VER) | |
32 | DL_FILE = $(THISAPP).tar.bz2 | |
33 | DL_FROM = $(URL_IPFIRE) | |
34 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
35 | ifeq "$(PASS)" "1" | |
36 | TARGET = $(DIR_INFO)/$(THISAPP)-pass1 | |
37 | else | |
38 | ifeq "$(PASS)" "2" | |
39 | TARGET = $(DIR_INFO)/$(THISAPP)-pass2 | |
40 | else | |
41 | TARGET = $(DIR_INFO)/$(THISAPP)-pass3 | |
42 | endif | |
43 | endif | |
44 | ||
45 | STAGING_DIR=/opt/$(MACHINE)-uClibc | |
46 | ||
47 | ############################################################################### | |
48 | # Top-level Rules | |
49 | ############################################################################### | |
50 | ||
51 | objects = $(DL_FILE) buildroot-snapshot-20061026.tar.bz2 uClibc-locale-030818.tgz | |
52 | ||
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 | |
56 | ||
57 | $(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29 | |
58 | buildroot-snapshot-20061026.tar.bz2_MD5 = ecc5d48a780e46a56d1d39207d5868bd | |
59 | uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6 | |
60 | ||
61 | install : $(TARGET) | |
62 | ||
63 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
64 | ||
65 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
66 | ||
67 | md5 : $(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) | |
88 | ifeq "$(PASS)" "1" | |
89 | @rm -rf $(DIR_APP) | |
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 \ | |
99 | DEVEL_PREFIX=/usr/ \ | |
100 | RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \ | |
101 | pregen install_dev | |
102 | else | |
103 | ifeq "$(PASS)" "2" | |
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 | |
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 | |
132 | else | |
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*} | |
136 | @rm -rf $(DIR_APP) | |
137 | endif | |
138 | endif | |
139 | @$(POSTBUILD) |