]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/Config
HinzugefĆ¼gt:
[ipfire-2.x.git] / lfs / Config
CommitLineData
cd1a2927
MT
1###############################################################################
2# LFSMake #
3# by Rod Roark <rod@sunsetsystems.com> #
4# #
5# Copyright (C) 2002 Rod Roark #
6# #
7# See http://www.lfsmake.org/ for the most current standard version. #
8# #
9# These Makefiles are made available under the terms of the Artistic License, #
10# found at http://www.opensource.org/licenses/artistic-license.html. #
11###############################################################################
12
13# URLs that are common sources of downloads. If you're having trouble with
14# a site you should change its URL to that of a suitable mirror site.
15#
16URL_CPAN = http://www.cpan.org/modules/by-module
17URL_AGNU = ftp://alpha.gnu.org/gnu
18URL_DEBIAN = http://http.us.debian.org/debian/pool/main
19URL_GNU = http://ftp.gnu.org/gnu
e9a97e8e 20URL_KERNEL = http://www.kernel.org/pub
cd1a2927
MT
21URL_TUE = ftp://ftp.win.tue.nl/pub
22URL_LFS_FTP = http://ftp.at.linuxfromscratch.org/pub/lfs/lfs-packages/5.1.1
23URL_LFS = http://www.linuxfromscratch.org/patches/downloads
24URL_SFNET = http://switch.dl.sourceforge.net/sourceforge
e9a97e8e
MT
25URL_IPFIRE = http://mirror.ipfire.org/source-packages
26URL_IPCOP = http://ipcop.ath.cx
cd1a2927
MT
27
28# Default compiler optimizations.
29#
30FLAGS_OPT = -O2
31FLAGS_CPU = -mcpu=$(MACHINE)
32FLAGS_ARCH = -march=$(MACHINE)
33
34# Don't change this; it will be overridden by other makefiles where necessary.
35#
36ROOT =
37
38# For most packages tarballs are unpacked here and then deleted after
39# installation.
40#
41DIR_SRC = $(ROOT)/usr/src
42
43# Files are downloaded into DIR_TMP and then moved to DIR_DL, to avoid
44# messes with partially retrieved files. DIR_DL is where we will
45# save all the files that are downloaded. DIR_INFO contains the
46# file lists of installed packages.
47#
48DIR_DL = $(LFS_BASEDIR)/cache
49DIR_CHK = $(LFS_BASEDIR)/cache/check
50DIR_INFO = $(LFS_BASEDIR)/log
557a2e1a 51DIR_TMP = /var/tmp
cd1a2927
MT
52
53KGCC = ccache /usr/bin/gcc
54
55###############################################################################
56# Common Macro Definitions
57###############################################################################
58
59# For each package we create a list of files that it installed under
60# log/<TARGET> name. Modified files are not identified
61#
62define FIND_FILES
63 cd $(ROOT)/ && find -mount \
64 -not -path './tools*' -not -path './tmp*' -not -path './usr/src*' \
65 -not -path './dev*' -not -path './proc*' -not -path './install*'
66endef
67
68# This is common starting logic for builds.
69#
70ifeq "$(ROOT)" ""
71define PREBUILD
72 echo "====================================== Installing $(THISAPP) ..."
73 @echo "Install started; saving file list to $(DIR_SRC)/lsalr ..."
74 @if [ ! -f $(DIR_SRC)/lsalr ]; then $(FIND_FILES) > $(DIR_SRC)/lsalr; fi
75endef
76else
77define PREBUILD
78 echo "====================================== Installing $(THISAPP) ..."
79endef
80endif
81
82# Common end-of-installation logic for Stage 2 and beyond.
83#
84ifeq "$(ROOT)" ""
85define POSTBUILD
86 @echo "Install done; saving file list to $(DIR_INFO)/$(THISAPP) ..."
87 @$(FIND_FILES) > $(DIR_SRC)/lsalrnew
88 @diff $(DIR_SRC)/lsalr $(DIR_SRC)/lsalrnew | grep '^> ' | sed 's/^> //' | sort > $(TARGET)_1
89 @cp -f $(DIR_SRC)/lsalrnew $(DIR_SRC)/lsalr
90 @rm -f $(DIR_SRC)/lsalrnew
91 sed -i -e 's+.\/++' $(TARGET)_1
92 # compare roofile ( same name as lfs script) with the list of installed files
93 # special cases
94 # - on a partial rebuild without a new file inside TARGET_1, just touch TARGET
95 if [ -s "$(TARGET)_1" ]; then \
96 ROOTFILE=$(DIR_SRC)/src/ROOTFILES.$(MACHINE); \
97 for line in `cat $(TARGET)_1`; do \
98 if grep -qE "^#$$line$$" $$ROOTFILE ; then echo "#$$line" >> $(TARGET); \
99 elif grep -qE "^$$line$$" $$ROOTFILE ; then echo "$$line" >> $(TARGET); \
100 else echo "+$$line" >> $(TARGET); \
101 fi; \
102 done; \
103 else \
104 touch $(TARGET); \
105 fi
106 @rm -f $(TARGET)_1
107endef
108else
109define POSTBUILD
110 @echo "===================================== Install done for $(THISAPP)."
111 touch $(TARGET)
112endef
113endif
114
115define CHECK
116 @echo -e "$(MESSAGE)Check: $($(notdir $@))"
117 wget -T 120 -t 1 --spider -nv $($(notdir $@)) -O /dev/null
118 @touch $(DIR_CHK)/$(notdir $@)
119endef
120
121define LOAD
122 @echo -e "$(MESSAGE)Download: $($(notdir $@))"
8a13df72 123 wget -T 60 -t 1 -c -nv $($(notdir $@)) -O $(DIR_TMP)/$(notdir $@)
cd1a2927
MT
124 [ "$($(notdir $@)_MD5)" = `md5sum $(DIR_TMP)/$(notdir $@) | awk '{ print $$1 }'` ] # detect page not found answer
125 mv $(DIR_TMP)/$(notdir $@) $(DIR_DL)
126endef
127
128define MD5
129 # error mean file signature don't match the one in lfs script
130 [ "$($@_MD5)" = `md5sum $(DIR_DL)/$@ | awk '{ print $$1 }'` ]
131 echo "$@ checksum OK"
132endef