]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - lfs/coreutils
Added a macro for cross-compilation.
[people/ms/ipfire-3.x.git] / lfs / coreutils
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302
MT
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 #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
be472d5a 27PKG_NAME = coreutils
055d20b2 28VER = 6.12
cd1a2927 29
be472d5a 30THISAPP = $(PKG_NAME)-$(VER)
ac07fd4d 31DL_FILE = $(THISAPP).tar.gz
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33
be472d5a 34TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
cd1a2927
MT
35
36###############################################################################
37# Top-level Rules
38###############################################################################
dd714b8a 39
055d20b2
MT
40objects = $(DL_FILE) $(THISAPP)-uname_PIC-1.patch $(THISAPP)-i18n-1.patch \
41 $(THISAPP)-old_build_kernel-1.patch
cd1a2927 42
cd1a2927
MT
43install : $(TARGET)
44
87703b91 45download : $(objects)
cd1a2927 46
87703b91 47$(objects) :
cd1a2927
MT
48 @$(LOAD)
49
cd1a2927
MT
50###############################################################################
51# Installation Details
52###############################################################################
53
4b804071 54$(TARGET) :
cd1a2927 55 @$(PREBUILD)
ac07fd4d 56 @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
055d20b2
MT
57 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-old_build_kernel-1.patch
58
ac07fd4d 59ifeq "$(STAGE)" "toolchain"
6be953be
MT
60 cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR) \
61 --enable-install-program=hostname
3d84c75d 62 cd $(DIR_APP) && make $(PARALLELISMFLAGS)
be472d5a 63 cd $(DIR_APP) && make install
3888140c 64
be472d5a 65 cd $(DIR_APP) && cp -v src/su $(TOOLS_DIR)/bin/su-tools
3888140c
MT
66endif
67
68ifeq "$(STAGE)" "base"
e2fc6a89 69 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-uname_PIC-1.patch
3888140c
MT
70 cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-i18n-1.patch
71
ac07fd4d 72 cd $(DIR_APP) && ./configure --prefix=/usr --enable-install-program=hostname \
6be953be 73 --enable-no-install-program=kill,uptime
3d84c75d 74 cd $(DIR_APP) && make $(PARALLELISMFLAGS)
3888140c
MT
75 cd $(DIR_APP) && make install
76
77 mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
78 mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} /bin
79 mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
80 mv -v /usr/bin/chroot /usr/sbin
81 mv -v /usr/bin/{head,sleep,nice} /bin
82endif
be472d5a 83
cd1a2927
MT
84 @rm -rf $(DIR_APP)
85 @$(POSTBUILD)