1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: makeedit.eclass
8 # @BLURB: An eclass to replace some flags in makefiles
12 # To use this eclass, do 2 things:
13 # 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do
14 # the append-flags afterward, otherwise you'll lose them.
15 # 2. after running configure or econf, call edit_makefiles to remove
16 # extraneous CFLAGS from your Makefiles.
19 # This combination should reduce the RAM requirements of your build, and maybe
20 # even speed it up a bit.
23 MAKEEDIT_FLAGS="-Wno-return-type -w"
25 # @FUNCTION: edit_makefiles
27 # Removes some flags in makefiles
29 # We already add "-Wno-return-type -w" to compiler flags, so
30 # no need to replace "-Wall" and "-Wreturn-type" with them.
31 einfo "Parsing Makefiles ..."
32 find . \( -iname makefile -o -name \*.mk -o -name GNUmakefile \) -print0 | \
35 -e 's:-Wreturn-type::g' \