diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /eclass/makeedit.eclass |
reinit the tree, so we can have metadata
Diffstat (limited to 'eclass/makeedit.eclass')
-rw-r--r-- | eclass/makeedit.eclass | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/eclass/makeedit.eclass b/eclass/makeedit.eclass new file mode 100644 index 000000000000..fb40cf781912 --- /dev/null +++ b/eclass/makeedit.eclass @@ -0,0 +1,36 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: makeedit.eclass +# @AUTHOR: +# Spider +# @BLURB: An eclass to replace some flags in makefiles +# @DESCRIPTION: +# +# @CODE +# To use this eclass, do 2 things: +# 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do +# the append-flags afterward, otherwise you'll lose them. +# 2. after running configure or econf, call edit_makefiles to remove +# extraneous CFLAGS from your Makefiles. +# @CODE +# +# This combination should reduce the RAM requirements of your build, and maybe +# even speed it up a bit. + + +MAKEEDIT_FLAGS="-Wno-return-type -w" + +# @FUNCTION: edit_makefiles +# @DESCRIPTION: +# Removes some flags in makefiles +edit_makefiles() { + # We already add "-Wno-return-type -w" to compiler flags, so + # no need to replace "-Wall" and "-Wreturn-type" with them. + einfo "Parsing Makefiles ..." + find . \( -iname makefile -o -name \*.mk -o -name GNUmakefile \) -print0 | \ + xargs -0 sed -i \ + -e 's:-Wall::g' \ + -e 's:-Wreturn-type::g' \ + -e 's:-pedantic::g' +} |