]>
Commit | Line | Data |
---|---|---|
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 | ||
27 | include Config | |
28 | ||
1d4ec104 | 29 | VER = 0.9.28 |
cd1a2927 MT |
30 | |
31 | THISAPP = uClibc-$(VER) | |
1d4ec104 | 32 | DL_FILE = $(THISAPP).tar.bz2 |
45405baa | 33 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 | 34 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
bc9f0c12 MT |
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 | |
cd1a2927 MT |
46 | |
47 | ############################################################################### | |
48 | # Top-level Rules | |
49 | ############################################################################### | |
50 | ||
b2c64f8c | 51 | objects = $(DL_FILE) uClibc-locale-030818.tgz |
cd1a2927 | 52 | |
a50d04ab | 53 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) |
a50d04ab | 54 | uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz |
cd1a2927 | 55 | |
a50d04ab | 56 | $(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29 |
a50d04ab | 57 | uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6 |
cd1a2927 MT |
58 | |
59 | install : $(TARGET) | |
60 | ||
61 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
62 | ||
63 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
64 | ||
65 | md5 : $(subst %,%_MD5,$(objects)) | |
66 | ||
67 | ############################################################################### | |
68 | # Downloading, checking, md5sum | |
69 | ############################################################################### | |
70 | ||
71 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
72 | @$(CHECK) | |
73 | ||
74 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
75 | @$(LOAD) | |
76 | ||
77 | $(subst %,%_MD5,$(objects)) : | |
78 | @$(MD5) | |
79 | ||
80 | ############################################################################### | |
81 | # Installation Details | |
82 | ############################################################################### | |
83 | ||
84 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
85 | @$(PREBUILD) | |
bc9f0c12 MT |
86 | ifeq "$(PASS)" "1" |
87 | @rm -rf $(DIR_APP) | |
a50d04ab | 88 | @mkdir -p /opt/$(MACHINE)-uClibc $(DIR_SRC)/uClibc_dev/usr/include $(DIR_SRC)/uClibc_dev/{,usr}/lib |
bc9f0c12 MT |
89 | @cd $(DIR_SRC) && tar xfj $(DIR_DL)/$(DL_FILE) |
90 | cp -f $(DIR_DL)/uClibc-locale-030818.tgz $(DIR_APP)/extra/locale/ | |
91 | cp -f $(DIR_SRC)/config/uClibc/{locales,codesets}.txt $(DIR_APP)/extra/locale | |
92 | cd $(DIR_APP)/extra/locale && patch -Np3 < $(DIR_SRC)/src/patches/uClibc-gcc4-genwctype.patch | |
93 | cp -f $(DIR_SRC)/config/uClibc/uClibc.config-$(MACHINE) $(DIR_APP)/.config | |
a50d04ab MT |
94 | cd $(DIR_APP) && make oldconfig |
95 | cd $(DIR_APP)/extra/locale && make | |
96 | cd $(DIR_APP) && make PREFIX=$(DIR_SRC)/uClibc_dev \ | |
97 | DEVEL_PREFIX=/usr/ \ | |
98 | RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \ | |
99 | pregen install_dev | |
bc9f0c12 MT |
100 | else |
101 | ifeq "$(PASS)" "2" | |
a50d04ab MT |
102 | cd $(DIR_APP) && make PREFIX= \ |
103 | DEVEL_PREFIX=/ \ | |
104 | RUNTIME_PREFIX=/ \ | |
105 | all | |
106 | cd $(DIR_APP) && make PREFIX= \ | |
107 | DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \ | |
108 | RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \ | |
109 | install_runtime install_dev | |
110 | ||
111 | ## This is to fix a small bug | |
112 | if [ ! -h /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib ]; then \ | |
113 | mv -vf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib/* /opt/$(MACHINE)-uClibc/lib/; \ | |
114 | rm -rf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \ | |
115 | ln -sfv ../lib /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \ | |
116 | fi | |
117 | ||
118 | cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \ | |
119 | hostutils | |
120 | cd $(DIR_APP) && make PREFIX=/install/initrd \ | |
121 | DEVEL_PREFIX=/usr/ \ | |
122 | RUNTIME_PREFIX=/ \ | |
123 | install_runtime | |
1d4ec104 MT |
124 | cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib |
125 | cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib | |
1d4ec104 MT |
126 | cd /lib && ln -sf ld-uClibc-$(VER).so ld-uClibc.so.0 |
127 | cd /lib && ln -sf libuClibc-$(VER).so libc.so.0 | |
128 | cd /lib && ln -sf libc.so.0 libc.so | |
bc9f0c12 MT |
129 | ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0 |
130 | else | |
a50d04ab | 131 | cd $(DIR_APP) && make PREFIX=/install/initrd utils install_utils |
bc9f0c12 MT |
132 | chmod 755 /install/initrd/lib/libuClibc-$(VER).so |
133 | rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*} | |
134 | @rm -rf $(DIR_APP) | |
135 | endif | |
136 | endif | |
cd1a2927 | 137 | @$(POSTBUILD) |