1This is the VMS version of GNU Make, updated by Hartmut Becker
2
3Changes are based on GNU make 3.82.
4
5This version was built and tested on OpenVMS V7.3 (VAX), V7.3-2 (Alpha) and
6V8.3-1H1 (I64).
7
8Build instructions
9Make a 1st version
10       $ @makefile.com  ! ignore any compiler and/or linker warning
11       $ rena make.exe 1st-make.exe
12Use the 1st version to generate a 2nd version
13       $ mc sys$disk:[]1st-make clean
14       $ mc sys$disk:[]1st-make
15Verify your 2nd version
16       $ rena make.exe 2nd-make.exe
17       $ mc sys$disk:[]2nd-make clean
18       $ mc sys$disk:[]2nd-make
19
20Changes (3.81.90)
21
22Michael Gehre (at VISTEC-SEMI dot COM) supplied a fix for a problem with
23timestamps of object modules in OLBs. The timestamps were not correctly
24adjusted to GMT based time, if the local VMS time was using a daylight saving
25algorithm and if daylight saving was switched off.
26
27John Eisenbraun (at HP dot COM) supplied fixes and and an enhancement to append
28output redirection in action lines.
29
30Rework of ctrl+c and ctrl+y handling.
31
32Fix a problem with cached strings, which showed on case-insensitive file
33systems.
34
35Build fixes for const-ified code in VMS specific sources.
36
37Build notes:
38- Try to avoid HP C V7.2-001, which has an incompatible change
39how __STDC__ is defined. This results at least in compile time warnings.
40
41- On V8.3-1H1, if you press Ctrl+C you may see a traceback, starting with
42%SYSTEM-F-CONTROLC, operation completed under CTRL/C
43%TRACE-F-TRACEBACK, symbolic stack dump follows
44image     module    routine               line      rel PC           abs PC
45
46DECC$SHR  C$SIGNAL  gsignal              27991 0000000000001180
47FFFFFFFF84AB2DA0
48DECC$SHR  C$SIGNAL  raise                28048 0000000000001280
49FFFFFFFF84AB2EA0
50DECC$SHR  C$SIGPENDING  decc$$deliver_signals
51                                         12475 0000000000000890
52FFFFFFFF84C13690
53...
54This looks like an incompatibility to the Alpha and VAX behavior, so it looks
55like a problem in I64 VMS version(s).
56
57- There is no clean build on VAX. In the environment I tested, I had to use GNU
58make's alloca which produced a couple of compile time warnings. It seems too
59much effort to work on a clean build on VAX.
60
61A note on appending the redirected output. With this change, a simple mechanism
62is implemented to make ">>" work in action lines. In VMS there is no simple
63feature like ">>" to have DCL command or program output redirected and appended
64to a file. GNU make for VMS already implements the redirection of output. If
65such a redirection is detected, an ">" on the action line, GNU make creates a
66DCL command procedure to execute the action and to redirect its output. Based
67on that, now ">>" is also recognized and a similar but different command
68procedure is created to implement the append. The main idea here is to create a
69temporary file which collects the output and which is appended to the wanted
70output file. Then the temporary file is deleted. This is all done in the
71command procedure to keep changes in make small and simple. This obviously has
72some limitations but it seems good enough compared with the current ">"
73implementation. (And in my opinion, redirection is not really what GNU make has
74to do.) With this approach, it may happen that the temporary file is not yet
75appended and is left in SYS$SCRATCH. The temporary file names look like
76"CMDxxxxx.". Any time the created command procedure can not complete, this
77happens. Pressing Ctrl+Y to abort make is one case. In case of Ctrl+Y the
78associated command procedure is left in SYS$SCRATCH as well. Its name is
79CMDxxxxx.COM.
80
81Change in the Ctrl+Y handling
82
83Ctrl+Y was: The CtrlY handler called $forcex for the current child.
84
85Ctrl+Y changed: The CtrlY handler uses $delprc to delete all children. This way
86also actions with DCL commands will be stopped. As before Ctrl+Y then sends
87SIGQUIT to itself, which is handled in common code.
88
89Change in deleteing temporary command files
90
91Temporary command files were deleted in the main line, after returning from the
92vms child termination handler. If Ctrl+C was pressed, the handler is called but
93did not return to main line.
94
95Now, temporary command files are deleted in the vms child termination
96handler. That deletes the them even if a Ctrl+C was pressed.
97
98The behavior of pressing Ctrl+C is not changed. It still has only an effect,
99after the current action is terminated. If that doesn't happen or takes too
100long, Ctrl+Y should be used instead.
101
102Changes (3.80)
103
104. In default.c define variable ARCH as IA64 for VMS on Itanium systems.
105
106. In makefile.vms avoid name collision for glob and globfree.
107
108In newer version of the VMS CRTL there are glob and globfree implemented.
109Compiling and linking may result in
110
111  %ILINK-W-MULDEFLNKG, symbol DECC$GLOBFREE has subsequent linkage definition
112       in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
113  %ILINK-W-MULDEF, symbol DECC$GLOBFREE multiply defined
114       in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
115
116linker messages (and similar for DECC$GLOB). The messages just say, that
117globfree is a known CRTL whose name was mapped by the compiler to
118DECC$GLOBFREE.  This is done in glob.c as well, so this name is defined
119twice. One possible solution is to use the VMS versions of glob and
120globfree. However, then the build environment needs to figure out if
121there is a new CRTL supporting these or not. This adds complexity. Even
122more, these functions return VMS file specifications, which is not
123expected by the other make sources. There is a switch at run time (a VMS
124logical DECC$GLOB_UNIX_STYLE), which can be set to get Unix style
125names. This may conflict with other software. The recommended solution
126for this is to set this switch just prior to calling main: in an
127initialization routine. This adds more complexity and more VMS specific
128code. It is easier to tell the compiler NOT to map the routine names
129with a simple change in makefile.vms.
130
131Some notes on case sensitive names in rules and on the disk. In the VMS
132template for CONFIG.H case sensitive rules can be enabled with defining
133WANT_CASE_SENSITIVE_TARGETS. For recent version of VMS there is a case
134sensitive file system: ODS5. To make use of that, additionally un-defining
135the HAVE_CASE_INSENSITIVE_FS is required. As these are C macros, different
136versions of make need to be built to have any case sensitivity for VMS
137working. Unfortunately, for ODS5 disks that's not all.
138
139- Usually DCL upcases command line tokens (except strings) and usually the
140  file system is case blind (similar to how Windows systems work)
141	$ set proc/parse=extended/case=sensitive
142  preserves lower and UPPER on the command line and (for this process and all
143  sub-processes) enables case sensitivity in the file system
144
145- Usually the CRTL tries to reverse what DCL did with command line tokens, it
146  lowercases all tokens (except strings)
147	$ define DECC$ARGV_PARSE_STYLE enable
148  passes (the now preserved) lower and UPPER from the command line to main()
149
150- Usually the CRTL upcases the arguments to open() and friends
151	$ define DECC$EFS_CASE_PRESERVE enable
152  preserves the names as is.
153
154It is important to know that not all VMS tools are ready for case sensitivity.
155With this setup some tools may not work as expected. The setup should not
156blindly be applied for all users in default login procedures.
157
158Example? The poor coding gives a compiler message, showing that there are
159different files:
160
161$ dir
162
163Directory ODS5DISK[HB]
164
165A.c;1               B.c;1               c.c;1               X.c;1
166x.c;1
167
168Total of 5 files.
169$ ods5make x.obj
170cc    /obj=x.obj x.c
171
172foo(){lowercase_x();}
173......^
174%CC-I-IMPLICITFUNC, In this statement, the identifier "lowercase_x" is implicitly declared as a function.
175at line number 1 in file ODS5DISK[HB]x.c;1
176$ mc SYS$SYSDEVICE:[HARTMUT.MAKE_3_80P]ods5make X.obj
177cc    /obj=X.obj X.c
178
179foo() {UPPERCASE_X();}
180.......^
181%CC-I-IMPLICITFUNC, In this statement, the identifier "UPPERCASE_X" is implicitly declared as a function.
182at line number 1 in file ODS5DISK[HB]X.c;1
183$ dir
184
185Directory ODS5DISK[HB]
186
187A.c;1               B.c;1               c.c;1               X.c;1
188x.c;1               X.obj;1             x.obj;1
189
190Total of 7 files.
191$
192
193This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
194
195It is based on the specific version 3.77k and on 3.78.1. 3.77k was done
196by Klaus K�mpf <kkaempf@rmi.de>, the code was based on the VMS port of
197GNU Make 3.60 by Mike Moretti.
198
199It was ported on OpenVMS/Alpha V7.1, DECC V5.7-006. It was re-build and
200tested on OpenVMS/Alpha V7.2, OpenVMS/VAX 7.1 and 5.5-2. Different
201versions of DECC were used. VAXC was tried: it fails; but it doesn't
202seem worth to get it working. There are still some PTRMISMATCH warnings
203during the compile. Although perl is working on VMS the test scripts
204don't work. The function $shell is still missing.
205
206There is a known bug in some of the VMS CRTLs. It is in the shipped
207versions of VMS V7.2 and V7.2-1 and in the currently (October 1999)
208available ECOs for VMS V7.1 and newer versions. It is fixed in versions
209shipped with newer VMS versions and all ECO kits after October 1999. It
210only shows up during the daylight saving time period (DST): stat()
211returns a modification time 1 hour ahead. This results in GNU make
212warning messages. For a just created source you will see:
213
214 $ gmake x.exe
215 gmake.exe;1: *** Warning: File `x.c' has modification time in the future (940582863 > 940579269)
216 cc    /obj=x.obj x.c
217 link  x.obj    /exe=x.exe
218 gmake.exe;1: *** Warning:  Clock skew detected.  Your build may be incomplete.
219
220
221New in 3.78.1:
222
223Fix a problem with automatically remaking makefiles. GNU make uses an
224execve to restart itself after a successful remake of the makefile. On
225UNIX systems execve replaces the running program with a new one and
226resets all signal handling to the default. On VMS execve creates a child
227process, signal and exit handlers of the parent are still active, and,
228unfortunately, corrupt the exit code from the child. Fix in job.c:
229ignore SIGCHLD.
230
231Added some switches to reflect latest features of DECC. Modifications in
232makefile.vms.
233
234Set some definitions to reflect latest features of DECC. Modifications in
235config.h-vms (which is copied to config.h).
236
237Added extern strcmpi declaration to avoid 'implicitly declared' messages.
238Modification in make.h.
239
240Default rule for C++, conditionals for gcc (GCC_IS_NATIVE) or DEC/Digital/
241Compaq c/c++ compilers. Modifications in default.c.
242
243Usage of opendir() and friends, suppress file version. Modifications in dir.c.
244
245Added VMS specific code to handle ctrl+c and ctrl+y to abort make.
246Modifications in job.c.
247
248Added support to have case sensitive targets and dependencies but to
249still use case blind file names. This is especially useful for Java
250makefiles on VMS:
251
252	.SUFFIXES :
253	.SUFFIXES :	.class .java
254	.java.class :
255		javac "$<
256	HelloWorld.class :      HelloWorld.java
257
258A new macro WANT_CASE_SENSITIVE_TARGETS in config.h-vms was introduced.
259It needs to be enabled to get this feature; default is disabled.  The
260macro HAVE_CASE_INSENSITIVE_FS must not be touched: it is still enabled.
261Modifications in file.c and config.h-vms.
262
263Bootstrap make to start building make is still makefile.com, but make
264needs to be re-made with a make to make a correct version: ignore all
265possible warnings, delete all objects, rename make.exe to a different
266name and run it.
267
268Made some minor modifications to the bootstrap build makefile.com.
269
270This is the VMS port of GNU Make.
271
272It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
273
274This port was done by Klaus K�mpf <kkaempf@rmi.de>
275
276There is first-level support available from proGIS Software, Germany.
277Visit their web-site at http://www.progis.de to get information
278about other vms software and forthcoming updates to gnu make.
279
280New for 3.77:
281
282/bin/sh style I/O redirection is supported. You can now write lines like
283	mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt
284
285Makefile variables are looked up in the current environment. You can set
286symbols or logicals in DCL and evaluate them in the Makefile via
287$(<name-of-symbol-or-logical>).  Variables defined in the Makefile
288override VMS symbols/logicals !
289
290Functions for file names are working now. See the GNU Make manual for
291$(dir ...)  and $(wildcard ...).  Unix-style and VMS-style names are
292supported as arguments.
293
294The default rules are set up for GNU C. Building an executable from a
295single source file is as easy as 'make file.exe'.
296
297The variable $(ARCH) is predefined as ALPHA or VAX resp. Makefiles for
298different VMS systems can now be written by checking $(ARCH) as in
299  ifeq ($(ARCH),ALPHA)
300    $(ECHO) "On the Alpha"
301  else
302    $(ECHO) "On the VAX"
303  endif
304
305Command lines of excessive length are correctly broken and written to a
306batch file in sys$scratch for later execution. There's no limit to the
307lengths of commands (and no need for .opt files :-) any more.
308
309Empty commands are handled correctly and don't end in a new DCL process.
310
311
312New for 3.76:
313
314John W. Eaton has updated the VMS port to support libraries and VPATH.
315
316
317To build Make, simply type @makefile.  This should compile all the
318necessary files and link Make.  There is also a file called
319makefile.vms.  If you already have GNU Make built you can just use
320Make with this makefile to rebuild.
321
322Here are some notes about GNU Make for VMS:
323
324The cd command is supported if it's called as $(CD). This invokes
325the 'builtin_cd' command which changes the directory.
326Calling 'set def' doesn't do the trick, since a sub-shell is
327spawned for this command, the directory is changed *in this sub-shell*
328and the sub-shell ends.
329
330Libraries are not supported. They were in GNU Make 3.60 but somehow I
331didn't care porting the code. If there is enough interest, I'll do it at
332some later time.
333
334The variable $^ separates files with commas instead of spaces (It's the
335natural thing to do for VMS).
336
337See defaults.c for VMS default suffixes and my definitions for default
338rules and variables.
339
340The shell function is not implemented yet.
341
342Load average routines haven't been implemented for VMS yet.
343
344The default include directory for including other makefiles is
345SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
346SYS$LIBRARY: instead; maybe it wouldn't work that way).
347
348The default makefiles make looks for are: makefile.vms, gnumakefile,
349makefile., and gnumakefile. .
350
351The stat() function and handling of time stamps in VMS is broken, so I
352replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
353somewhere in the future. Be warned, the time resolution inside make is
354less than what vms provides. This might be a problem on the faster Alphas.
355
356You can use a : in a filename only if you preceed it with a backslash ('\').
357E.g.- hobbes\:[bogas.files]
358
359Make ignores success, informational, or warning errors (-S-, -I-, or
360-W-).  But it will stop on -E- and -F- errors. (unless you do something
361to override this in your makefile, or whatever).
362
363Remote stuff isn't implemented yet.
364
365Multiple line DCL commands, such as "if" statements, must be put inside
366command files.  You can run a command file by using \@.
367
368
369VMS changes made for 3.74.3
370
371Lots of default settings are adapted for VMS. See default.c.
372
373Long command lines are now converted to command files.
374
375Comma (',') as a separator is now allowed. See makefile.vms for an example.
376
377-------------------------------------------------------------------------------
378Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3792006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
380This file is part of GNU Make.
381
382GNU Make is free software; you can redistribute it and/or modify it under the
383terms of the GNU General Public License as published by the Free Software
384Foundation; either version 3 of the License, or (at your option) any later
385version.
386
387GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
388WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
389A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
390
391You should have received a copy of the GNU General Public License along with
392this program.  If not, see <http://www.gnu.org/licenses/>.
393