home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 3: Developer Tools
/
Linux Cubed Series 3 - Developer Tools.iso
/
devel
/
lang
/
lisp
/
gcl-1.000
/
gcl-1
/
gcl-1.0
/
xbin
/
strip-ifdef
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1990-01-15
|
364 b
|
11 lines
#!/bin/sh
# Sample usage strip-ifdef foo.c -Dmips -DATT
# will select only code in those ifdefs which are selected by mips and ATT.
# includes, and defines will be left intact, as will comments
cat $1 | sed -e "s:^#include:XX#include:g" -e "s:^#define:XX#define:g" > /tmp/tmpx.c
shift 1
gcc -E -C /tmp/tmpx.c $@ | sed -e "/^#/d" -e "s:XX#:#:g" -e "/^$/d" | cb