OSDN Git Service

($(OBJC_O)): Also depend on $(GCC_PASSES).
[pf3gnuchains/gcc-fork.git] / gcc / make-cccp.com
1 $v='f$verify(0) !make-cccp.com
2 $!
3 $!      Build the GNU C preprocessor on VMS.
4 $!
5 $!      Usage:
6 $!        $ @make-cccp.com [compiler] [link-only]
7 $!
8 $!      where [compiler] is one of "GNUC", "VAXC", "DECC";
9 $!      default when none specified is "GNUC",
10 $!      and where [link-only] is "LINK" or omitted.
11 $!      If both options are specified, the compiler must come first.
12 $!
13 $ if f$type(gcc_debug).eqs."INTEGER" then  if gcc_debug.and.1 then  set verify
14 $
15 $ p1 = f$edit(p1,"UPCASE,TRIM")
16 $ if p1.eqs."" then  p1 = "GNUC"
17 $!
18 $!      Compiler-specific setup (assume GNU C, then override as necessary):
19 $!
20 $ CC     = "gcc"
21 $ CFLAGS = "/Debug/noVerbos"
22 $ LIBS   = "gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr"
23 $ if p1.nes."GNUC"
24 $ then
25 $   CC     = "cc"
26 $   CFLAGS = "/noOpt"   !disable optimizer when bootstrapping with native cc
27 $   if p1.eqs."VAXC"
28 $   then
29 $     if f$trnlnm("DECC$CC_DEFAULT").nes."" then  CC = "cc/VAXC"
30 $     LIBS = "alloca.obj,sys$library:vaxcrtl.olb/Libr"
31 $     define/noLog SYS SYS$LIBRARY:
32 $   else
33 $     if p1.eqs."DECC"
34 $     then
35 $       if f$trnlnm("DECC$CC_DEFAULT").nes."" then  CC = "cc/DECC"
36 $       LIBS = "alloca.obj"     !DECC$SHR will be found implicitly by linker
37 $       define/noLog SYS DECC$LIBRARY_INCLUDE:
38 $     else
39 $       if p1.nes."LINK"
40 $       then
41 $         type sys$input: /Output=sys$error:
42 $DECK
43 [compiler] argument should be one of "GNUC", "VAXC", or "DECC".
44
45 Usage:
46 $ @make-cccp.com [compiler] [link-only]
47
48 $EOD
49 $         exit %x1000002C + 0*f$verify(v)       !%SYSTEM-F-ABORT
50 $       endif !!LINK
51 $     endif !DECC
52 $   endif !VAXC
53 $ endif !!GNUC
54 $
55 $!
56 $!      Other setup:
57 $!
58 $ LDFLAGS =     "/noMap"
59 $ PARSER  =     "bison"
60 $ RENAME  =     "rename/New_Version"
61 $ LINK    =     "link"
62 $ echo    =     "write sys$output"
63 $
64 $!!!!!!!
65 $!      Nothing beyond this point should need any local configuration changes.
66 $!!!!!!!
67 $
68 $! Set the default directory to the same place as this command procedure.
69 $ flnm = f$enviroment("PROCEDURE")      !get current procedure name
70 $ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
71 $
72 $ if p1.eqs."LINK" .or. p2.eqs."LINK" then  goto Link
73 $ echo " Building the preprocessor."
74 $
75 $! Compile the simplest file first, to catch problem with compiler setup early.
76 $ set verify
77 $ 'CC''CFLAGS' version.c
78 $!'f$verify(0)
79 $
80 $ set verify
81 $ 'CC''CFLAGS' cccp.c
82 $!'f$verify(0)
83 $
84 $! Compile preprocessor's parser, possibly making it with yacc first.
85 $ if f$search("CEXP.C").nes."" then -
86     if f$cvtime(f$file_attributes("CEXP.C","RDT")).ges.-
87        f$cvtime(f$file_attributes("CEXP.Y","RDT")) then  goto skip_yacc
88 $ set verify
89 $ 'PARSER' cexp.y
90 $ 'RENAME' cexp_tab.c cexp.c
91 $!'f$verify(0)
92 $skip_yacc:
93 $ echo " (Ignore any warning about not finding file ""bison.simple"".)"
94 $ set verify
95 $ 'CC''CFLAGS' cexp.c
96 $!'f$verify(0)
97
98 $! In case there's no builtin alloca support, use the C simulation.
99 $ if f$locate("alloca.obj",f$edit(LIBS,"lowercase")).lt.f$length(LIBS)
100 $ then
101 $  set verify
102 $ 'CC''CFLAGS'/Incl=[]/Defi=("HAVE_CONFIG_H","STACK_DIRECTION=(-1)") alloca.c
103 $!'f$verify(0)
104 $ endif
105 $!
106 $
107 $Link:
108 $ echo " Linking the preprocessor."
109 $ set verify
110 $ 'LINK''LDFLAGS'/Exe=gcc-cpp.exe -
111           cccp.obj,cexp.obj,version.obj,version.opt/Opt,-
112           'LIBS'
113 $!'f$verify(0)
114 $!
115 $!      Done
116 $!
117 $ exit 1+0*f$verify(v)