mpw-make.sed 2.58 KB
# Sed commands to finish translating the Unix BFD Makefile into MPW syntax.

# Whack out unused host and target define bits.
/S/s/@HDEFINES@//
/S/s/@TDEFINES@//

# Fix pathnames to include directories.
/ /s/^INCDIR = .*$/INCDIR = "{topsrcdir}"include/
/ /s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/

# Comment out setting of vars, configure script will add these itself.
/=/s/^/#/
# /^ALL_BACKENDS/s/^/#/
/S/s/^/#/
/S/s/^/#/
/S/s/^/#/

# Remove extra, useless, "all".
/t/,/$/d

# Remove the Makefile rebuild rule.
/ /,/k/d

# Don't do any recursive subdir stuff.
/o/s/{MAKE}/null-command/

/H/s/^{BFD_H}/#{BFD_H}/

# Add explicit srcdir paths to special files.
/d/s/ config.bfd/ "{s}"config.bfd/g
/d/s/ targmatch.sed/ "{s}"targmatch.sed/g

# Point at include files that are always in the objdir.
/d/s/"{s}"bfd\.h/"{o}"bfd.h/g
/g/s/"{s}"config\.h/"{o}"config.h/g
/h/s/"{s}"targmatch\.h/"{o}"targmatch.h/g
/h/s/^targmatch\.h/"{o}"targmatch.h/
/t/s/"{s}"elf32-target\.h/"{o}"elf32-target.h/g
/t/s/^elf32-target\.h/"{o}"elf32-target.h/
/t/s/"{s}"elf64-target\.h/"{o}"elf64-target.h/g
/t/s/^elf64-target\.h/"{o}"elf64-target.h/

/}/s/"{s}"{INCDIR}/"{INCDIR}"/g

/p/s/\.dep/__dep/g

# Removing duplicates is cool but presently unnecessary,
# so whack this out.
/f/,/$/d
/ofiles/s/{OFILES} ofiles/{OFILES}/
/ /d
/cat ofiles/s/`cat ofiles`/{OFILES}/

# No corefile support.
/E/s/@COREFILE@//
/G/s/@COREFLAG@//

# No PIC foolery in this environment.
/@/s/@ALLLIBS@/{TARGETLIB}/
/@/s/@PICLIST@//
/@/s/@PICFLAG@//
/r/,/$/d

# Remove the pic trickery from the default build rule.
/ /,/f/c\
.c.o \\Option-f .c

# MPW Make doesn't know about $<.
/e/,/$/c\
"{o}"targets.c.o \\Option-f "{s}"targets.c Makefile\
	{CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"targets.c -o "{o}"targets.c.o

/e/,/$/c\
"{o}"archures.c.o \\Option-f "{s}"archures.c Makefile\
	{CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"archures.c -o "{o}"archures.c.o

# Remove the .h rebuilding rules, we don't currently have a doc subdir,
# or a way to build the prototype-hacking tool that's in it.
/ /,/$/d
/^"{srcdir}"libbfd.h \\Option-f /,/^$/d
/^"{srcdir}"libcoff.h \\Option-f /,/^$/d