OSDN Git Service

87th Cygnus<->FSF quick merge
[pf3gnuchains/gcc-fork.git] / gcc / cp / mpw-make.sed
1 # Sed commands to finish translating the G++ Unix makefile into MPW syntax.
2
3 # Remove control-Ls, they upset MPW make.
4 s/\f//g
5
6 # Remove references to always-empty variables used to mark things.
7 /CYGNUS-LOCAL-/s/{CYGNUS-LOCAL-[a-z0-9]*}//g
8
9 # Add a bunch of definitions, mostly empty.
10 /^# Variables that exist for you to override.$/a\
11 \
12 xmake_file = \
13 tmake_file = \
14 build_xm_file = \
15 MALLOC = \
16 MD_DEPS = \
17 REAL_H = \
18 HOST_CC_LD = {CC_LD}\
19 ALL_CCLDFLAGS = \
20 HOST_CCLDFLAGS = \
21 CONFIG_H = \
22 LIBDEPS = \
23
24 # The "target" variable is special to MPW make, avoid it.
25 /{target}/s/{target}/{target_canonical}/g
26
27 # Suppress the suppression of smart makes.
28 /^\.y\.c/d
29
30 # Whack out "..." assignments.
31 /\.\.\./s/^\([a-z_]*= \.\.\.\)/#\1/
32
33 # Previous edits go a little overboard, undo.
34 /^objext = /s/"{o}"//
35
36 # Always link in low-level MPW functions.
37 /^LIBDEPS=/s/$/ ::strerror.c.o ::mpwlib.c.o/
38 /{CLIB}/s/{CLIB}/ ::strerror.c.o ::mpwlib.c.o {CLIB}/
39
40 # Don't get tricky about finding various .o file, point at dir above.
41 /^SUBDIR_OBSTACK/s/`.*`/::obstack.c.o/
42 /^SUBDIR_USE_ALLOCA/s/`.*`/::alloca.c.o/
43 /^SUBDIR_MALLOC/s/`.*`//
44
45 # Point includes at parent directly correctly.
46 /^INCLUDES = .*$/s/:\./::/g
47 /^INCLUDES = .*$/s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g
48
49 # Add the special MPW include dirs.
50 /^INCLUDES = .*$/s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/
51
52 # A nasty hack to reduce confusion.
53 /true/s/ ; @true$//
54
55 # (should be in common translation?)
56 /{CC_LD} /s/$/ {EXTRALIBS}/
57
58 # Don't use general compiler flags (which may include definitions
59 # and other compiler-only bits) with linking commands.
60 /{CC_LD} /s/ALL_CFLAGS/ALL_CCLDFLAGS/
61
62 # Whack out build rules that are not useful.
63 /^Makefile \\Option-f /,/^$/d
64 /^config.status \\Option-f /,/^$/d
65 # (Note that MPW make is not case sensitive, and so this name
66 # is considered the same as "md_file".)
67 /^{MD_FILE} \\Option-f/,/^$/d
68
69 # Depending on config.status is not useful for us.
70 /config.status/s/ config.status//
71
72 # Repeat of stuff from generic edit.
73 /{s}/s/"{s}""{s}"/"{s}"/g
74 /{s}/s/"{s}""{srcdir}"/"{s}"/g
75 /{s}/s/"{srcdir}""{s}"/"{s}"/g
76
77 # Fix references to C frontend files in main dir.
78 /::c-/s/"{o}"::c-/"{o}":c-/g
79
80 # Fix pathnames to generated files in the objdir.
81 /parse/s/"{s}"parse\.\([chy]\)/"{o}"parse.\1/g
82 /parse/s/^parse\.\([chy]\)/"{o}"parse.\1/
83 /y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
84 /y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
85 /y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
86 /y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
87
88 # Put in the definition of YYEMPTY directly.
89 /grep/s/grep .* >>/Echo '#define YYEMPTY -1' >>/
90
91 # If the dates are wrong, then this tries to run gperf, which we don't
92 # really want.
93 /^"{srcdir}"hash.h/,/hash.h$/d
94
95 # Sed the object file list instead of using cat (meow).
96 /cat/s/`cat /`sed -e 's,:,::,g' -e 's,{objext},.o,g' /
97
98 # Simplify dependencies of generated parser files.
99 /^{PARSE_C}/s/^/#/
100 /^stamp-parse/s/^stamp-parse/{PARSE_C}/
101
102 # Fix the compile line for the generated parser.
103 /{CC} -c/,/echo {PARSE_C}/c\
104         {CC} {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\
105
106 # Change all Rez commands to use mac-gcc.r.
107 /{REZ}/s/"{s}"[-a-zA-Z{}]*\.r/"{topsrcdir}"gcc:mac-gcc.r/
108
109 # Remove pathname junk from the container name.
110 /{REZ}/s/'"'::cc1plus'"'/'"'cc1plus'"'/