1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
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. #
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. #
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 #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
21 ###############################################################################
23 ###############################################################################
25 ###############################################################################
32 DL_FILE = $(THISAPP).tar.bz2
33 DL_FROM = $(URL_IPFIRE)
34 DIR_APP = $(DIR_SRC)/$(THISAPP)
38 # Normal build or /tools build.
41 TARGET = $(DIR_INFO)/$(THISAPP)
42 EXTRA_CONFIG = --prefix=/usr \
43 --libexecdir=/usr/lib --enable-shared \
44 --enable-threads=posix --enable-__cxa_atexit \
45 --enable-clocale=gnu --enable-languages=c,c++ \
51 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
52 EXTRA_CONFIG = --prefix=/tools \
53 --with-local-prefix=/tools --disable-nls --enable-shared \
55 EXTRA_MAKE = BOOT_LDFLAGS="-static" bootstrap
58 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
59 EXTRA_CONFIG = --prefix=/tools \
60 --with-local-prefix=/tools --enable-clocale=gnu \
61 --enable-shared --enable-threads=posix \
62 --enable-__cxa_atexit --enable-languages=c,c++ \
63 --disable-libstdcxx-pch
69 ###############################################################################
71 ###############################################################################
74 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
76 $(DL_FILE)_MD5 = 6ff1af12c53cbb3f79b27f2d6a9a3d50
80 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
82 download :$(patsubst %,$(DIR_DL)/%,$(objects))
84 md5 : $(subst %,%_MD5,$(objects))
86 ###############################################################################
87 # Downloading, checking, md5sum
88 ###############################################################################
90 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
93 $(patsubst %,$(DIR_DL)/%,$(objects)) :
96 $(subst %,%_MD5,$(objects)) :
99 ###############################################################################
100 # Installation Details
101 ###############################################################################
103 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
105 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
106 @mkdir $(DIR_SRC)/gcc-build
108 cd $(DIR_APP) && sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
109 #cd $(DIR_APP) && sed -i 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in
110 cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
111 cd $(DIR_APP) && sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in
113 cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG)
114 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING)
115 cd $(DIR_SRC)/gcc-build && make install
116 ln -sfv ../usr/bin/cpp /lib
117 ln -sfv gcc /usr/bin/cc
120 cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG)
121 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
122 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
123 ln -sfv gcc /tools/bin/cc
125 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
126 cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
127 cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp}
128 #cd $(DIR_APP) && sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp > gcc/Makefile.in
129 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-specs-1.patch
130 cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG)
131 cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
132 cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
135 @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build