From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: jhpb@sarto.gaithersburg.md.us (Joseph H. Buehler) Cc: egcs@cygnus.com Subject: Re: Compiling without -g Date: Tue, 20 Jan 1998 12:42:00 -0000 Message-id: <199801202016.MAA09336@atrus.synopsys.com> References: X-SW-Source: 1998-01/msg00725.html > Jonathan Buzzard writes: > > > I grabed a copy of egcs-1.0.1 in order to get a better C++ compiler than > > gcc-2.7.2. However without going round editting all the Makefiles is > > there anyway to stop it using the -g flag everywhere as I am a little > > short on disk space. Warning: you don't want to compile your libraries without -g, or your users won't be able to debug fully (even if they use -g for their own code, the lack of -g in the libraries will mean, for instance, that the debugger things iostreams, strings, etc are unknown classes). > Here's what I do sometimes: > > find -type f | > xargs grep -l 'FLAGS[ ]*=' | > xargs perl -p -i -e 's#(-O\d?|-g)\b#-O#g if (/FLAGS\s*=/)' You don't need to edit the makefiles; it suffices to say, for example make CFLAGS=-O2