]> err.no Git - sope/blob - gnustep-make/strip_makefiles.sh
gnu runtime bugfix
[sope] / gnustep-make / strip_makefiles.sh
1 #!/bin/sh
2 # strip_makefiles.sh
3 #
4 # Copyright (C) 2003 Free Software Foundation, Inc.
5 #
6 # Author: Nicola Pero <n.pero@mi.flashnet.it>
7 # Date: October 2003
8 #
9 # This file is part of the GNUstep Makefile Package.
10 #
11 # This library is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15
16 # You should have received a copy of the GNU General Public
17 # License along with this library; see the file COPYING.LIB.
18 # If not, write to the Free Software Foundation,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21 # This script "strips" the makefiles and shell scripts.
22
23 # By "stripping" a makefile we mean removing all comments, and all
24 # empty lines.  This reduces considerably the size of makefiles and
25 # the amount of data that each make invocation has to read; the
26 # makefiles execute slightly faster.  You shouldn't over-estimate the
27 # performance issue though - stripped makefiles execute only 5% faster
28 # on my machine.
29
30 # The disadvantage of stripped makefiles is that we remove comments
31 # and makefiles become almost unreadable.
32
33 for makefile in *.make Master/*.make Instance/*.make Instance/Shared/*.make Instance/Documentation/*.make; do
34   sed -e '/^ *#/d' -e '/^$/d' ${makefile} > ${makefile}.stripped;
35   mv ${makefile}.stripped ${makefile};
36 done
37
38 for shell_script in *.sh *.csh; do
39   sed -e '/^ *#/d' -e '/^$/d' ${shell_script} > ${shell_script}.stripped;
40   mv ${shell_script}.stripped ${shell_script};
41   chmod 755 ${shell_script};
42 done
43