5357995
pl0 

所属分类:编译器/解释器
开发工具:C/C++
文件大小:14KB
下载次数:28
上传日期:2005-03-03 22:07:03
上 传 者quzw2803
说明:  pl0编译器
(pl0 compiler)

文件列表:
535765\CHECK.C (2123, 1996-09-01)
535765\H.H (2429, 1997-06-17)
535765\INPUT.C (6850, 1997-04-26)
535765\MACRO.C (3349, 1997-05-11)
535765\MAIN.C (4619, 1997-07-09)
535765\MAKE.C (7686, 1997-05-11)
535765\MAKEFILE (473, 1997-08-28)
535765\READER.C (1982, 1997-03-29)
535765\RULES.C (2589, 1996-09-16)
535765\Cn700.com.txt (2916, 2004-10-04)
535765 (0, 2004-11-14)

Following is a repost of the public domain 'make' that I posted to net.sources a couple of months ago. I have fixed a few bugs, and added some more features, and the resulting changes amounted to about as much text as the whole program (hence the repost). For those that missed the net.sources posting, this is a public domain re-implementation of the UNIX make program. There is no manual included; for documentation, refer to a UNIX manual, or the source. Here is a list of the changes made: i) If '-' (ignore) or '@' (silent) where used at the start of a command, their effect was not turned off for the following commands. ii) A special target (.SUFFIXES, .PRECIOUS) or a rule (.c.o, .a.o), if first in the file would be taken as the default target. This resulted in error messages like "Don't know how to make .c", because things like .SUFFIXES were being made. This was further complicated by --- iii) Special target lines with no dependents (ie. .SUFFIXES:\n) were not clearing out the existing dependents like they should. iv) Default rules could not be redefined because of the error checking for commands being defined twice. Now you are allowed to define a target beinging with '.', having no dependents with commands. v) The -q option didn't do the time comparison correctly, or clear the variable used to keep track of this. Thus it didn't work very well. vi) The syntax ${..} for macro's supported by UNIX make was not supported. vii) There wuz a couple of spelling errors. viii) When make checked for implicit rules on targets without a suffix, there were problems. (Note: The ~ feature of UNIX make wasn't and still isn't supported) ix) The -n option did not print @ lines like it was supposed to. x) :: added. (See UNIX manual) xi) $? added. (see UNIX manual) =========================== This 'make' is based on a usenet version that was posted to mod.sources in December of 1***6. I have added some #defines to enable compilation with Microsoft C, version 4.0, under MS-DOS. Within the bounds of legality, this is as close as one can get to REAL unix make on a DOS machine. If anyone ever again spends money for a DOS make program they either: 1) don't know about this version, or 2) are crazy. Let's distribute this widely to take care of the first case. As to the second case, that probably doesn't matter- most of them are using MacIntoshes! - Paul Homchick Sysop, GEnie IBM RoundTable January 11, 1***7 (For information on how to use make, see any text on unix programming, or, any unix documentation. While this source code is P.D., the AT&T documentation is not.) These are the default rules for this implementation: macro "CC" = "cc" macro "CFLAGS" = "-O" rule "c.obj" command "$(CC) $(CFLAGS) -c $<" macro "AS" = "masm" rule ".asm.obj" command "$(AS) $<;" suffixes: ".obj" ".asm" ".c" ".SUFFIXES" =========================== Further changes for MS-DOS, made by Rahul Dhesi. All changes will compile with Microsoft C version 3.0, but are compiler-specific and will probably not work with any other compiler (with the possible exception of Microsoft C version 4.0). 1***7/02/01 (a) If switchchar had been set to other than "/", using Make made the system go haywire. Included my own system() function that recognizes switchar. File affected: new file `msdos.c'. (b) System() function always invoked MS-DOS's command interpreter. As a result, the return code from the executed command was lost, since MS-DOS's command interpreter always returns a zero exit code. Fixed as follows: My system() function first tries to execute the command directly by creating a process with the help of the spawn() library function of Microsoft C. If this fails, only then is the command interpreter invoked. This means that all commands other than those executed by the MS-DOS command interpreter will return a proper exit code. File affected: `msdos.c'. This does have the side effect that if there is a program called COPY.COM or COPY.EXE, that will be executed in preference to the command interpreter's command COPY. This is not necessarily a bad thing. (c) User interrupts were being ignored. Added some signal() calls to trap any user interrupt and increment a flag. Also added kbhit() function call to check console status after each command is executed and (with any luck) recognize any user interrupt. User interrupt handling is now somewhat improved. File affected: `msdos.c'. (d) Added "$*" macro which stands for target minus suffix. File affected: `make.c'. Remaining known bug: A command-line macro definition, as in make "switch = -o" xyz should override a macro definition of `switch' in the makefile. It does not. One way of fixing this would be to change the structure of macro definitions to indicate whether or not the current macro definition is a command-line definition. Then a command-line definition would never be replaced by one within the makefile. -- R.D. 1***7/02/01 -------- Ported to lcc-win32 Included rules for lcc-win32, added some system dependent features Had similar problems with system(), so created my own implementation Had problems with the timing and touching, so ended up with a bunch of Windows95 specific code -- paag 1996/01/09 Included a simple substitution mechanism in the macro expansion code the sintax is $(VAR;old=new) where VAR is an valid macro variable old is a string in this variable new is the string it has to be changed to e.g. if SRC = alloc.c dothing.c then OBJ = $(SRC;.c=.obj) expands to OBJ = alloc.obj dothing.obj WARNING: the substitution mechanism is CASE SENSITIVE -- paag 1996/02/10

近期下载者

相关文件


收藏者