diff options
Diffstat (limited to 'dmake/msdos')
99 files changed, 7099 insertions, 0 deletions
diff --git a/dmake/msdos/arlib.c b/dmake/msdos/arlib.c new file mode 100644 index 000000000000..ecd556b7d621 --- /dev/null +++ b/dmake/msdos/arlib.c @@ -0,0 +1,56 @@ +/* RCS $Id: arlib.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Library access code. +-- +-- DESCRIPTION +-- This implementation uses the library timestamp inplace of the +-- library member timestamp. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include "extern.h" + +PUBLIC time_t +seek_arch(name, lib) +char* name; +char* lib; +{ + static int warned = FALSE; + + if (!warned && !(Glob_attr&A_SILENT)) + warned = TRUE, + Warning("Can't extract library member timestamp;\n\ + using library timestamp instead."); + return (Do_stat(lib, NULL, NULL, TRUE)); +} + +PUBLIC int +touch_arch(name, lib) +char* name; +char* lib; +{ + static int warned = FALSE; + + if (!warned && !(Glob_attr&A_SILENT)) + warned = TRUE, + Warning("Can't update library member timestamp;\n\ + touching library instead."); + return (Do_touch(lib, NULL, NULL)); +} + diff --git a/dmake/msdos/borland/bcc30/config.h b/dmake/msdos/borland/bcc30/config.h new file mode 100644 index 000000000000..3db5098145fa --- /dev/null +++ b/dmake/msdos/borland/bcc30/config.h @@ -0,0 +1,48 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:08 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +/*#define coreleft() 0L*/ +extern unsigned int coreleft(); + +#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */ + +/* Turbo-C understands const declarations. */ +#define CONST const + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/borland/bcc30/config.mk b/dmake/msdos/borland/bcc30/config.mk new file mode 100644 index 000000000000..0b1d122a868c --- /dev/null +++ b/dmake/msdos/borland/bcc30/config.mk @@ -0,0 +1,8 @@ + +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +LDLIBS = e:/cc/borland/bcc30/lib/c$(MODEL) +CSTARTUP = e:/cc/borland/bcc30/lib/c0$(MODEL).obj + +CFLAGS += -I$(osedir) -w-pia diff --git a/dmake/msdos/borland/bcc30/lib.rsp b/dmake/msdos/borland/bcc30/lib.rsp new file mode 100644 index 000000000000..41e591347bae --- /dev/null +++ b/dmake/msdos/borland/bcc30/lib.rsp @@ -0,0 +1 @@ +d:\cc\borland\bcc30\lib\cl diff --git a/dmake/msdos/borland/bcc30/libswp.rsp b/dmake/msdos/borland/bcc30/libswp.rsp new file mode 100644 index 000000000000..64f053bf1fb1 --- /dev/null +++ b/dmake/msdos/borland/bcc30/libswp.rsp @@ -0,0 +1 @@ +e:\cc\borland\bcc30\lib\cl diff --git a/dmake/msdos/borland/bcc30/mkswp.bat b/dmake/msdos/borland/bcc30/mkswp.bat new file mode 100755 index 000000000000..9266d8dfc0cd --- /dev/null +++ b/dmake/msdos/borland/bcc30/mkswp.bat @@ -0,0 +1,107 @@ +md objects +tasm -t -mx -dmlarge msdos\exec.asm,,,; +mv exec.obj objects +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia infer.c +copy infer.obj objects +del infer.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia make.c +copy make.obj objects +del make.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia stat.c +copy stat.obj objects +del stat.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia expand.c +copy expand.obj objects +del expand.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmstring.c +copy dmstring.obj objects +del dmstring.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia hash.c +copy hash.obj objects +del hash.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dag.c +copy dag.obj objects +del dag.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmake.c +copy dmake.obj objects +del dmake.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia path.c +copy path.obj objects +del path.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia imacs.c +copy imacs.obj objects +del imacs.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia sysintf.c +copy sysintf.obj objects +del sysintf.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia parse.c +copy parse.obj objects +del parse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia getinp.c +copy getinp.obj objects +del getinp.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia quit.c +copy quit.obj objects +del quit.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia state.c +copy state.obj objects +del state.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia dmdump.c +copy dmdump.obj objects +del dmdump.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia macparse.c +copy macparse.obj objects +del macparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia rulparse.c +copy rulparse.obj objects +del rulparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia percent.c +copy percent.obj objects +del percent.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia function.c +copy function.obj objects +del function.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\runargv.c +copy runargv.obj objects +del runargv.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\arlib.c +copy arlib.obj objects +del arlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\switchar.c +copy switchar.obj objects +del switchar.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\spawn.c +copy spawn.obj objects +del spawn.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\find.c +copy find.obj objects +del find.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia unix\dcache.c +copy dcache.obj objects +del dcache.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\borland\tempnam.c +copy tempnam.obj objects +del tempnam.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc30 -w-pia msdos\borland\utime.c +copy utime.obj objects +del utime.obj +tlink @msdos\borland\bcc30\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc30\libswp.rsp +copy msdos\borland\bcc30\template.mk startup\config.mk diff --git a/dmake/msdos/borland/bcc30/obj.rsp b/dmake/msdos/borland/bcc30/obj.rsp new file mode 100644 index 000000000000..3f396242ce36 --- /dev/null +++ b/dmake/msdos/borland/bcc30/obj.rsp @@ -0,0 +1,34 @@ +d:\cc\borland\bcc30\lib\c0l.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\tee.obj+ +objects\dirlib.obj+ +objects\find.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc30/objswp.rsp b/dmake/msdos/borland/bcc30/objswp.rsp new file mode 100644 index 000000000000..aa0bf5e5831a --- /dev/null +++ b/dmake/msdos/borland/bcc30/objswp.rsp @@ -0,0 +1,36 @@ +e:\cc\borland\bcc30\lib\c0l.obj+ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc30/public.h b/dmake/msdos/borland/bcc30/public.h new file mode 100644 index 000000000000..dde6da773177 --- /dev/null +++ b/dmake/msdos/borland/bcc30/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:43:40 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/borland/bcc30/template.mk b/dmake/msdos/borland/bcc30/template.mk new file mode 100644 index 000000000000..df574e09c7aa --- /dev/null +++ b/dmake/msdos/borland/bcc30/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= borland + OSENVIRONMENT *:= bcc30 diff --git a/dmake/msdos/borland/bcc40/config.h b/dmake/msdos/borland/bcc40/config.h new file mode 100644 index 000000000000..3a9b58383498 --- /dev/null +++ b/dmake/msdos/borland/bcc40/config.h @@ -0,0 +1,51 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:30 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +/*#define coreleft() 0L*/ +extern unsigned int coreleft(); + +#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */ + +/* Turbo-C understands const declarations. */ +#define CONST const + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Borland redefined the environment variable, sigh */ +#define environ _environ + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/borland/bcc40/config.mk b/dmake/msdos/borland/bcc40/config.mk new file mode 100644 index 000000000000..550b86950705 --- /dev/null +++ b/dmake/msdos/borland/bcc40/config.mk @@ -0,0 +1,7 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL) +CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj + +CFLAGS += -I$(osedir) -w-pro diff --git a/dmake/msdos/borland/bcc40/lib.rsp b/dmake/msdos/borland/bcc40/lib.rsp new file mode 100644 index 000000000000..828ccf4ab0b8 --- /dev/null +++ b/dmake/msdos/borland/bcc40/lib.rsp @@ -0,0 +1,2 @@ +e:\cc\borland\bcc40\lib\cw32+ +e:\cc\borland\bcc40\lib\import32 diff --git a/dmake/msdos/borland/bcc40/libswp.rsp b/dmake/msdos/borland/bcc40/libswp.rsp new file mode 100644 index 000000000000..1557935cd40c --- /dev/null +++ b/dmake/msdos/borland/bcc40/libswp.rsp @@ -0,0 +1 @@ +e:\cc\borland\bcc40\lib\cl diff --git a/dmake/msdos/borland/bcc40/mkswp.bat b/dmake/msdos/borland/bcc40/mkswp.bat new file mode 100755 index 000000000000..d8a1bf824de4 --- /dev/null +++ b/dmake/msdos/borland/bcc40/mkswp.bat @@ -0,0 +1,107 @@ +md objects +tasm -t -mx -dmlarge msdos\exec.asm,,,; +mv exec.obj objects +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro infer.c +copy infer.obj objects +del infer.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro make.c +copy make.obj objects +del make.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro stat.c +copy stat.obj objects +del stat.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro expand.c +copy expand.obj objects +del expand.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmstring.c +copy dmstring.obj objects +del dmstring.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro hash.c +copy hash.obj objects +del hash.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dag.c +copy dag.obj objects +del dag.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmake.c +copy dmake.obj objects +del dmake.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro path.c +copy path.obj objects +del path.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro imacs.c +copy imacs.obj objects +del imacs.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro sysintf.c +copy sysintf.obj objects +del sysintf.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro parse.c +copy parse.obj objects +del parse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro getinp.c +copy getinp.obj objects +del getinp.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro quit.c +copy quit.obj objects +del quit.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro state.c +copy state.obj objects +del state.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro dmdump.c +copy dmdump.obj objects +del dmdump.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro macparse.c +copy macparse.obj objects +del macparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro rulparse.c +copy rulparse.obj objects +del rulparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro percent.c +copy percent.obj objects +del percent.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro function.c +copy function.obj objects +del function.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\runargv.c +copy runargv.obj objects +del runargv.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\arlib.c +copy arlib.obj objects +del arlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\switchar.c +copy switchar.obj objects +del switchar.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\spawn.c +copy spawn.obj objects +del spawn.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\find.c +copy find.obj objects +del find.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro unix\dcache.c +copy dcache.obj objects +del dcache.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\borland\tempnam.c +copy tempnam.obj objects +del tempnam.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc40 -w-pro msdos\borland\utime.c +copy utime.obj objects +del utime.obj +tlink @msdos\borland\bcc40\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc40\libswp.rsp +copy msdos\borland\bcc40\template.mk startup\config.mk diff --git a/dmake/msdos/borland/bcc40/obj.rsp b/dmake/msdos/borland/bcc40/obj.rsp new file mode 100644 index 000000000000..572259dca8ea --- /dev/null +++ b/dmake/msdos/borland/bcc40/obj.rsp @@ -0,0 +1,34 @@ +e:\cc\borland\bcc40\lib\c0x32.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\find.obj+ +objects\tee.obj+ +objects\dirlib.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc40/objswp.rsp b/dmake/msdos/borland/bcc40/objswp.rsp new file mode 100644 index 000000000000..712d47f47504 --- /dev/null +++ b/dmake/msdos/borland/bcc40/objswp.rsp @@ -0,0 +1,36 @@ +e:\cc\borland\bcc40\lib\c0l.obj+ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc40/public.h b/dmake/msdos/borland/bcc40/public.h new file mode 100644 index 000000000000..0e80be51da3e --- /dev/null +++ b/dmake/msdos/borland/bcc40/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:43:53 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/borland/bcc40/template.mk b/dmake/msdos/borland/bcc40/template.mk new file mode 100644 index 000000000000..30a27692f3ed --- /dev/null +++ b/dmake/msdos/borland/bcc40/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= borland + OSENVIRONMENT *:= bcc40 diff --git a/dmake/msdos/borland/bcc45/config.h b/dmake/msdos/borland/bcc45/config.h new file mode 100644 index 000000000000..b59a431fa317 --- /dev/null +++ b/dmake/msdos/borland/bcc45/config.h @@ -0,0 +1,51 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:44 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +/*#define coreleft() 0L*/ +extern unsigned int coreleft(); + +#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */ + +/* Turbo-C understands const declarations. */ +#define CONST const + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Borland redefined the environment variable, sigh */ +#define environ _environ + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/borland/bcc45/config.mk b/dmake/msdos/borland/bcc45/config.mk new file mode 100644 index 000000000000..550b86950705 --- /dev/null +++ b/dmake/msdos/borland/bcc45/config.mk @@ -0,0 +1,7 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL) +CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj + +CFLAGS += -I$(osedir) -w-pro diff --git a/dmake/msdos/borland/bcc45/lib.rsp b/dmake/msdos/borland/bcc45/lib.rsp new file mode 100644 index 000000000000..db2b78d82438 --- /dev/null +++ b/dmake/msdos/borland/bcc45/lib.rsp @@ -0,0 +1,2 @@ +e:\cc\borland\bcc45\lib\cw32+ +e:\cc\borland\bcc45\lib\import32 diff --git a/dmake/msdos/borland/bcc45/libswp.rsp b/dmake/msdos/borland/bcc45/libswp.rsp new file mode 100644 index 000000000000..1557935cd40c --- /dev/null +++ b/dmake/msdos/borland/bcc45/libswp.rsp @@ -0,0 +1 @@ +e:\cc\borland\bcc40\lib\cl diff --git a/dmake/msdos/borland/bcc45/mkswp.bat b/dmake/msdos/borland/bcc45/mkswp.bat new file mode 100755 index 000000000000..c6bfede2f370 --- /dev/null +++ b/dmake/msdos/borland/bcc45/mkswp.bat @@ -0,0 +1,107 @@ +md objects +tasm -t -mx -dmlarge msdos\exec.asm,,,; +mv exec.obj objects +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro infer.c +copy infer.obj objects +del infer.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro make.c +copy make.obj objects +del make.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro stat.c +copy stat.obj objects +del stat.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro expand.c +copy expand.obj objects +del expand.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmstring.c +copy dmstring.obj objects +del dmstring.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro hash.c +copy hash.obj objects +del hash.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dag.c +copy dag.obj objects +del dag.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmake.c +copy dmake.obj objects +del dmake.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro path.c +copy path.obj objects +del path.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro imacs.c +copy imacs.obj objects +del imacs.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro sysintf.c +copy sysintf.obj objects +del sysintf.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro parse.c +copy parse.obj objects +del parse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro getinp.c +copy getinp.obj objects +del getinp.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro quit.c +copy quit.obj objects +del quit.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro state.c +copy state.obj objects +del state.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro dmdump.c +copy dmdump.obj objects +del dmdump.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro macparse.c +copy macparse.obj objects +del macparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro rulparse.c +copy rulparse.obj objects +del rulparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro percent.c +copy percent.obj objects +del percent.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro function.c +copy function.obj objects +del function.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\runargv.c +copy runargv.obj objects +del runargv.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\arlib.c +copy arlib.obj objects +del arlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\switchar.c +copy switchar.obj objects +del switchar.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\spawn.c +copy spawn.obj objects +del spawn.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\find.c +copy find.obj objects +del find.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro unix\dcache.c +copy dcache.obj objects +del dcache.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\borland\tempnam.c +copy tempnam.obj objects +del tempnam.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc45 -w-pro msdos\borland\utime.c +copy utime.obj objects +del utime.obj +tlink @msdos\borland\bcc45\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc45\libswp.rsp +copy msdos\borland\bcc45\template.mk startup\config.mk diff --git a/dmake/msdos/borland/bcc45/obj.rsp b/dmake/msdos/borland/bcc45/obj.rsp new file mode 100644 index 000000000000..e1d4b1e23186 --- /dev/null +++ b/dmake/msdos/borland/bcc45/obj.rsp @@ -0,0 +1,34 @@ +e:\cc\borland\bcc45\lib\c0x32.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\find.obj+ +objects\tee.obj+ +objects\dirlib.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc45/objswp.rsp b/dmake/msdos/borland/bcc45/objswp.rsp new file mode 100644 index 000000000000..712d47f47504 --- /dev/null +++ b/dmake/msdos/borland/bcc45/objswp.rsp @@ -0,0 +1,36 @@ +e:\cc\borland\bcc40\lib\c0l.obj+ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc45/public.h b/dmake/msdos/borland/bcc45/public.h new file mode 100644 index 000000000000..b8d43eb32dc9 --- /dev/null +++ b/dmake/msdos/borland/bcc45/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:06 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/borland/bcc45/template.mk b/dmake/msdos/borland/bcc45/template.mk new file mode 100644 index 000000000000..83b5e009033d --- /dev/null +++ b/dmake/msdos/borland/bcc45/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= borland + OSENVIRONMENT *:= bcc45 diff --git a/dmake/msdos/borland/bcc50/config.h b/dmake/msdos/borland/bcc50/config.h new file mode 100644 index 000000000000..cd1a8cca5016 --- /dev/null +++ b/dmake/msdos/borland/bcc50/config.h @@ -0,0 +1,51 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:36:58 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +/*#define coreleft() 0L*/ +extern unsigned int coreleft(); + +#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */ + +/* Turbo-C understands const declarations. */ +#define CONST const + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Borland redefined the environment variable, sigh */ +#define environ _environ + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/borland/bcc50/config.mk b/dmake/msdos/borland/bcc50/config.mk new file mode 100644 index 000000000000..550b86950705 --- /dev/null +++ b/dmake/msdos/borland/bcc50/config.mk @@ -0,0 +1,7 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +LDLIBS = e:/cc/borland/bcc40/lib/c$(MODEL) +CSTARTUP = e:/cc/borland/bcc40/lib/c0$(MODEL).obj + +CFLAGS += -I$(osedir) -w-pro diff --git a/dmake/msdos/borland/bcc50/lib.rsp b/dmake/msdos/borland/bcc50/lib.rsp new file mode 100644 index 000000000000..fd89d29f284c --- /dev/null +++ b/dmake/msdos/borland/bcc50/lib.rsp @@ -0,0 +1,2 @@ +e:\cc\borland\bcc50\lib\cw32+ +e:\cc\borland\bcc50\lib\import32 diff --git a/dmake/msdos/borland/bcc50/libswp.rsp b/dmake/msdos/borland/bcc50/libswp.rsp new file mode 100644 index 000000000000..1557935cd40c --- /dev/null +++ b/dmake/msdos/borland/bcc50/libswp.rsp @@ -0,0 +1 @@ +e:\cc\borland\bcc40\lib\cl diff --git a/dmake/msdos/borland/bcc50/mkswp.bat b/dmake/msdos/borland/bcc50/mkswp.bat new file mode 100755 index 000000000000..14de52506f56 --- /dev/null +++ b/dmake/msdos/borland/bcc50/mkswp.bat @@ -0,0 +1,107 @@ +md objects +tasm -t -mx -dmlarge msdos\exec.asm,,,; +mv exec.obj objects +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro infer.c +copy infer.obj objects +del infer.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro make.c +copy make.obj objects +del make.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro stat.c +copy stat.obj objects +del stat.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro expand.c +copy expand.obj objects +del expand.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmstring.c +copy dmstring.obj objects +del dmstring.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro hash.c +copy hash.obj objects +del hash.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dag.c +copy dag.obj objects +del dag.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmake.c +copy dmake.obj objects +del dmake.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro path.c +copy path.obj objects +del path.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro imacs.c +copy imacs.obj objects +del imacs.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro sysintf.c +copy sysintf.obj objects +del sysintf.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro parse.c +copy parse.obj objects +del parse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro getinp.c +copy getinp.obj objects +del getinp.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro quit.c +copy quit.obj objects +del quit.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro state.c +copy state.obj objects +del state.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro dmdump.c +copy dmdump.obj objects +del dmdump.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro macparse.c +copy macparse.obj objects +del macparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro rulparse.c +copy rulparse.obj objects +del rulparse.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro percent.c +copy percent.obj objects +del percent.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro function.c +copy function.obj objects +del function.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\runargv.c +copy runargv.obj objects +del runargv.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\arlib.c +copy arlib.obj objects +del arlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\switchar.c +copy switchar.obj objects +del switchar.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\spawn.c +copy spawn.obj objects +del spawn.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\find.c +copy find.obj objects +del find.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro unix\dcache.c +copy dcache.obj objects +del dcache.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\borland\tempnam.c +copy tempnam.obj objects +del tempnam.obj +bcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\bcc50 -w-pro msdos\borland\utime.c +copy utime.obj objects +del utime.obj +tlink @msdos\borland\bcc50\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\bcc50\libswp.rsp +copy msdos\borland\bcc50\template.mk startup\config.mk diff --git a/dmake/msdos/borland/bcc50/obj.rsp b/dmake/msdos/borland/bcc50/obj.rsp new file mode 100644 index 000000000000..08ea653f70f4 --- /dev/null +++ b/dmake/msdos/borland/bcc50/obj.rsp @@ -0,0 +1,34 @@ +e:\cc\borland\bcc50\lib\c0x32.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\find.obj+ +objects\tee.obj+ +objects\dirlib.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc50/objswp.rsp b/dmake/msdos/borland/bcc50/objswp.rsp new file mode 100644 index 000000000000..712d47f47504 --- /dev/null +++ b/dmake/msdos/borland/bcc50/objswp.rsp @@ -0,0 +1,36 @@ +e:\cc\borland\bcc40\lib\c0l.obj+ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/bcc50/public.h b/dmake/msdos/borland/bcc50/public.h new file mode 100644 index 000000000000..b9d491239c91 --- /dev/null +++ b/dmake/msdos/borland/bcc50/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:19 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/borland/bcc50/template.mk b/dmake/msdos/borland/bcc50/template.mk new file mode 100644 index 000000000000..51b575677985 --- /dev/null +++ b/dmake/msdos/borland/bcc50/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= borland + OSENVIRONMENT *:= bcc50 diff --git a/dmake/msdos/borland/config.mk b/dmake/msdos/borland/config.mk new file mode 100644 index 000000000000..42361968671d --- /dev/null +++ b/dmake/msdos/borland/config.mk @@ -0,0 +1,46 @@ +# This is the Turbo C++ 2.0 DOS configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +# The following sources are required for TURBO C++ 2.0 +OSR_SRC = tempnam.c utime.c +.SETDIR=$(osrdir) : $(OSR_SRC) + +SRC += $(OSR_SRC) +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS. Make sure your turboc.cfg +# file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line +# below! +#CFLAGS += -DM_I86=1 -D__STDC__=1 + +# You can get a smaller executable still, buy adding a -1 to the list of +# flags below, but then you can't run this on an 8086/88 cpu. +#CFLAGS += -1 +CFLAGS += -I$(osrdir) -d -O -N- -w-nod $(C_$(MODEL)) +ASFLAGS += -t -mx $(S_$(MODEL)) + +# Debugging information for Turbo-C +DB_CFLAGS += -v +DB_LDFLAGS += /v + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END + +C_s = +C_m = -mm +C_c = -mc +C_l = -ml + +S_s = -dmsmall +S_m = -dmmedium +S_c = -dmcompact +S_l = -dmlarge diff --git a/dmake/msdos/borland/tcc20/config.h b/dmake/msdos/borland/tcc20/config.h new file mode 100644 index 000000000000..27fae79049cf --- /dev/null +++ b/dmake/msdos/borland/tcc20/config.h @@ -0,0 +1,48 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:12 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +/*#define coreleft() 0L*/ +extern unsigned int coreleft(); + +#define SIGQUIT SIGTERM /* turbo C doesn't understand SIGQUIT */ + +/* Turbo-C understands const declarations. */ +#define CONST const + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/borland/tcc20/config.mk b/dmake/msdos/borland/tcc20/config.mk new file mode 100644 index 000000000000..e7c53757d2b6 --- /dev/null +++ b/dmake/msdos/borland/tcc20/config.mk @@ -0,0 +1,10 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +LDLIBS = e:/cc/borland/tcc20/lib/c$(MODEL) +CSTARTUP = e:/cc/borland/tcc20/lib/c0$(MODEL).obj + +CFLAGS += -I$(osedir) -f- + +# Case of identifiers is significant +NDB_LDFLAGS += -c diff --git a/dmake/msdos/borland/tcc20/libswp.rsp b/dmake/msdos/borland/tcc20/libswp.rsp new file mode 100644 index 000000000000..68d583f00580 --- /dev/null +++ b/dmake/msdos/borland/tcc20/libswp.rsp @@ -0,0 +1 @@ +e:\cc\borland\tcc20\lib\cl diff --git a/dmake/msdos/borland/tcc20/mkswp.bat b/dmake/msdos/borland/tcc20/mkswp.bat new file mode 100755 index 000000000000..52f6748e8ef3 --- /dev/null +++ b/dmake/msdos/borland/tcc20/mkswp.bat @@ -0,0 +1,107 @@ +md objects +tasm -t -mx -dmlarge msdos\exec.asm,,,; +mv exec.obj objects +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- infer.c +copy infer.obj objects +del infer.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- make.c +copy make.obj objects +del make.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- stat.c +copy stat.obj objects +del stat.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- expand.c +copy expand.obj objects +del expand.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmstring.c +copy dmstring.obj objects +del dmstring.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- hash.c +copy hash.obj objects +del hash.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dag.c +copy dag.obj objects +del dag.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmake.c +copy dmake.obj objects +del dmake.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- path.c +copy path.obj objects +del path.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- imacs.c +copy imacs.obj objects +del imacs.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- sysintf.c +copy sysintf.obj objects +del sysintf.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- parse.c +copy parse.obj objects +del parse.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- getinp.c +copy getinp.obj objects +del getinp.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- quit.c +copy quit.obj objects +del quit.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- state.c +copy state.obj objects +del state.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- dmdump.c +copy dmdump.obj objects +del dmdump.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- macparse.c +copy macparse.obj objects +del macparse.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- rulparse.c +copy rulparse.obj objects +del rulparse.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- percent.c +copy percent.obj objects +del percent.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- function.c +copy function.obj objects +del function.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\runargv.c +copy runargv.obj objects +del runargv.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\arlib.c +copy arlib.obj objects +del arlib.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\switchar.c +copy switchar.obj objects +del switchar.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\spawn.c +copy spawn.obj objects +del spawn.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\find.c +copy find.obj objects +del find.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- unix\dcache.c +copy dcache.obj objects +del dcache.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\borland\tempnam.c +copy tempnam.obj objects +del tempnam.obj +tcc -c -I. -Imsdos -Imsdos\borland -d -O -N- -w-nod -ml -Imsdos\borland\tcc20 -f- msdos\borland\utime.c +copy utime.obj objects +del utime.obj +tlink /c @msdos\borland\tcc20\objswp.rsp,dmake.exe,NUL.MAP,@msdos\borland\tcc20\libswp.rsp +copy msdos\borland\tcc20\template.mk startup\config.mk diff --git a/dmake/msdos/borland/tcc20/objswp.rsp b/dmake/msdos/borland/tcc20/objswp.rsp new file mode 100644 index 000000000000..c177fda3efbd --- /dev/null +++ b/dmake/msdos/borland/tcc20/objswp.rsp @@ -0,0 +1,36 @@ +e:\cc\borland\tcc20\lib\c0l.obj+ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\utime.obj diff --git a/dmake/msdos/borland/tcc20/public.h b/dmake/msdos/borland/tcc20/public.h new file mode 100644 index 000000000000..c56278966b05 --- /dev/null +++ b/dmake/msdos/borland/tcc20/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:32 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/borland/tcc20/template.mk b/dmake/msdos/borland/tcc20/template.mk new file mode 100644 index 000000000000..3cac6b22a240 --- /dev/null +++ b/dmake/msdos/borland/tcc20/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= borland + OSENVIRONMENT *:= tcc20 diff --git a/dmake/msdos/borland/tempnam.c b/dmake/msdos/borland/tempnam.c new file mode 100644 index 000000000000..c4d599de5971 --- /dev/null +++ b/dmake/msdos/borland/tempnam.c @@ -0,0 +1,109 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:28 hr Exp $ +-- +-- SYNOPSIS +-- tempnam +-- +-- DESCRIPTION +-- temp file name generation routines. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <dos.h> + +#if defined(max) +# undef max +#endif +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); +int d_access(); + +/* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */ +/* Under DOS leave the default tmpdir pointing here! */ +#ifndef P_tmpdir +static char *P_tmpdir = ""; +#endif + +char * +tempnam(dir, prefix) +char *dir; /* use this directory please (if non-NULL) */ +char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + static int count = 0; + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + char buf[30]; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) ) + if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) ) + if( d_access( strcpy(p, P_tmpdir), 0) != 0 ) + if( !prefix ) + prefix = "tp"; + + if(prefix) + { + *(p+strlen(p)+2) = '\0'; + (void)strncat(p, prefix, 2); + } + + sprintf( buf, "%08x", _psp ); + buf[6]='\0'; + (void)strcat(p, buf ); + sprintf( buf, "%04d", count++ ); + q=p+strlen(p)-6; + *q++ = buf[0]; *q++ = buf[1]; + *q++ = buf[2]; *q = buf[3]; + + if( (q = strrchr(p,'.')) != NULL ) *q = '\0'; + + return(p); +} + + + +d_access( name, flag ) +char *name; +int flag; +{ + extern char *DirSepStr; + char *p; + int r; + + if( name == NULL || !*name ) return(1); /* NULL dir means current dir */ + r = access( name, flag ); + p = name+strlen(name)-1; + + if(*p != '/' && *p != '\\') strcat( p, DirSepStr ); + + return( r ); +} diff --git a/dmake/msdos/borland/utime.c b/dmake/msdos/borland/utime.c new file mode 100644 index 000000000000..2b87022fe3f1 --- /dev/null +++ b/dmake/msdos/borland/utime.c @@ -0,0 +1,66 @@ +/* RCS $Id: utime.c,v 1.1.1.1 2000-09-22 15:33:28 hr Exp $ +-- +-- SYNOPSIS +-- utime +-- +-- DESCRIPTION +-- chage the last modified time on a file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#include <sys/stat.h> +#include <stdlib.h> +#include <stdio.h> +#include <fcntl.h> +#include <io.h> +#include <time.h> + +int +utime(name, timep)/* +==================== + Broken for turbo C it only sets the file time to the current time by + touching a character in the file */ +char* name; +time_t timep[2]; +{ + struct stat buf; + int fil; + char data; + + if (stat(name, &buf) != 0) + return (-1); + if (buf.st_size != 0) { + if ((fil = open(name, O_RDWR, S_IWRITE)) < 0) + return (-1); + if (read(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + lseek(fil, 0L, 0); + if (write(fil, &data, 1) < 1) { + close(fil); + return (-1); + } + close(fil); + return (0); + } else if ((fil = creat(name, S_IWRITE)) < 0) { + return (-1); + } else { + close(fil); + return (0); + } +} diff --git a/dmake/msdos/config.mk b/dmake/msdos/config.mk new file mode 100644 index 000000000000..77a32bf419de --- /dev/null +++ b/dmake/msdos/config.mk @@ -0,0 +1,71 @@ +# This is an OS specific configuration file +# It assumes that OBJDIR, TARGET and DEBUG are previously defined. +# It defines CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS +# It augments SRC, OBJDIR, TARGET, CFLAGS, LDLIBS +# + +# Memory model to compile for +# set to s - small, m - medium, c - compact, l - large +# Need large model now, dmake has grown up :-) +MODEL = l + +STARTUPFILE = $(OS)/startup.mk + +CPPFLAGS = $(CFLAGS) +LDOBJS = $(CSTARTUP) $(OBJDIR)/{$(<:f)} +LDARGS = $(LDHEAD) $(LDFLAGS:s/ //) @$(LDTMPOBJ),$(TARGET),NUL.MAP$(LDTAIL) +LDTAIL = $(_libs) +_libs = $(!null,$(LDLIBS) ,@$(LDTMPLIB)) +LDTMPOBJ = $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"+\n")\n) +LDTMPLIB = $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"+\n")\n) + +# Debug flags +DB_CFLAGS = -DDBUG +DB_LDFLAGS = +DB_LDLIBS = + +# NO Debug flags +NDB_CFLAGS = +NDB_LDFLAGS = +NDB_LDLIBS = + +# Local configuration modifications for CFLAGS. +CFLAGS += -I$(OS) + +# Common MSDOS source files. +# Define SWAP to anything but 'y' for the swap code to be excluded on making. +# Swapping for DOS versions is enabled by default. +# Note: swapping is handled specially for ZTC in msdos/zortech/config.mk. +SWAP *= y + +.IF $(OSRELEASE) != zortech + .IF $(SWAP) == y + SWP_SRC += spawn.c + ASRC += exec.asm + .ELSE + SWP_SRC += tee.c + .END +.ELSE + SWP_SRC += tee.c +.END + +OS_SRC += ruletab.c dirbrk.c runargv.c arlib.c dchdir.c switchar.c rmprq.c\ + $(SWP_SRC) find.c dirlib.c dstrlwr.c +UNIXSRC := dcache.c +SRC += $(OS_SRC) $(UNIXSRC) +.SETDIR=$(OS) : $(ASRC) $(OS_SRC) +.SETDIR=unix : $(UNIXSRC) + +# Provide our own %$O : %$S rule. +%$O : %$S + +$(AS) $(ASFLAGS) $(<:s,\,${__.DIVSEP-sh-${USESHELL}},:s,/,${__.DIVSEP-sh-${USESHELL}},),,,; + mv $(@:f) $(OBJDIR) + +# Set source dirs so that we can find files named in this +# config file. +.SOURCE.h : $(OS) + +# See if we modify anything in the lower levels. +.IF $(OSRELEASE) != $(NULL) + .INCLUDE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk +.END diff --git a/dmake/msdos/dchdir.c b/dmake/msdos/dchdir.c new file mode 100644 index 000000000000..19006825b7f6 --- /dev/null +++ b/dmake/msdos/dchdir.c @@ -0,0 +1,47 @@ +/* RCS $Id: dchdir.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Change directory. +-- +-- DESCRIPTION +-- Under DOS change the current drive as well as the current directory. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <dos.h> +#include "extern.h" + +PUBLIC int +dchdir(path) +char *path; +{ + int res; + + res = chdir(path); + + if (res != -1 && path[1] == ':') { + union REGS reg; + + /* we must change the logged drive, since the chdir worked. */ + reg.h.ah = 0x0E; + reg.h.dl = (*path & ~0x20) - 'A' + 1; + intdos(®, ®); + } + + return (res); +} diff --git a/dmake/msdos/dirbrk.c b/dmake/msdos/dirbrk.c new file mode 100644 index 000000000000..d8aab76b6f96 --- /dev/null +++ b/dmake/msdos/dirbrk.c @@ -0,0 +1,42 @@ +/* RCS $Id: dirbrk.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Define the directory separator string. +-- +-- DESCRIPTION +-- Define this string for any character that may appear in a path name +-- and can be used as a directory separator. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include "extern.h" + +/* dos uses /, \, and : */ +char* DirBrkStr = "/\\:"; + +/* +** Return TRUE if the name is the full specification of a path name to a file +** starting at the root of the file system, otherwise return FALSE +*/ +PUBLIC int +If_root_path(name) +char *name; +{ + return( (strchr(DirBrkStr, *name) != NIL(char)) || + (isalpha(*name) && name[1] == ':') ); +} diff --git a/dmake/msdos/dirent.h b/dmake/msdos/dirent.h new file mode 100644 index 000000000000..24ad5681da59 --- /dev/null +++ b/dmake/msdos/dirent.h @@ -0,0 +1,32 @@ +/* DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 */ + +#ifndef _DIRLIB_h_ +#define _DIRLIB_h_ + +#include <stdio.h> +#include "stdmacs.h" +#include "dosdta.h" + +#define MAXNAMLEN 15 + +struct dirent { + long d_ino; + unsigned short d_reclen; + unsigned short d_namlen; + char d_name[MAXNAMLEN+1]; +}; + +typedef struct { + DTA dd_dta; /* disk transfer area for this dir. */ + short dd_stat; /* status return from last lookup */ + char dd_name[1]; /* full name of file -- struct is extended */ +} DIR; + +extern DIR *opendir ANSI((char *)); +extern struct dirent *readdir ANSI((DIR *)); +extern long telldir ANSI((DIR *)); +extern void seekdir ANSI((DIR *, long)); +extern void closedir ANSI((DIR *)); + +#define rewinddir(dirp) seekdir(dirp,0L) +#endif diff --git a/dmake/msdos/dirlib.c b/dmake/msdos/dirlib.c new file mode 100644 index 000000000000..eaef928772af --- /dev/null +++ b/dmake/msdos/dirlib.c @@ -0,0 +1,285 @@ +/* + DIRLIB for MS-DOS + ----------------- + +Enclosed is an implementation of the `dirlib' package for MS-DOS. +The implementation is targeted for MS-C, although any reasonably +competent C compiler should manage. The package consists of: + + dir.h the header file + dir.c the functions + testdir.c a q&d test program + +The package tries to view directory naming in a Un*x light; in particular, +directories such as '/.' and '/..' (as well as `.' and `..' if your +current directory is root) are understood. Indefinite paths like +`/../.././../..' will correctly refer to the root (of the particular disk). +Names such as `a:////./../' are okay too. + +I've tried to be as sensible about DTA's as possible, since you never +know who will be using one; they are set before use, and reset afterwards. + +There is some cruft in the package, namely the way `seekdir' and +`telldir' are done. The code was derived from a little experimentation, +and may not work after a certain point (although I believe the 2.x version +to be solid). Caveat utilitor. + +Documentation for the package is available in the public domain; the +package's functionality was derived from this documentation. + +Bug reports and comments are welcome. Enjoy! + + - Matt + +------- +UUCP: {ucbvax,ihnp4,randvax,trwrb!trwspp,ism780}!ucla-cs!matt +ARPA: matt@LOCUS.UCLA.EDU +Ph: (213) 825-2756 + +-------- +Modified for use in dmake by Dennis Vadura. Mostly just clean up and an +effort to make correctly typed objects are passed to functions in find.c. +Also deleted all dos version 2.0 specific code. It is not required any +more. +*/ + +/* + * revision history: + * + * VER MM/DD/YY COMMENTS + * ---- -------- -------- + * 0.99 02/24/86 Beta release to INTERNET + */ + +#include <stdlib.h> +#include <ctype.h> +#include <errno.h> +#include <string.h> +#include <dos.h> + +#include "dirent.h" + +extern int find_err; + + +static char * +getdcwd(drive) +int drive; +{ + union REGS r; + struct SREGS s; + static char xcwd[64]; + char far *cwd = xcwd; + + r.h.ah = 0x47; + r.h.dl = drive; + r.x.si = FP_OFF(cwd); + s.ds = FP_SEG(cwd); + intdosx(&r, &r, &s); + find_err = r.x.ax; + if (r.x.cflag) + return (char *) 0; + return xcwd; +} + + + +/* + * opendir + */ + +#define SUFFIX "\\*.*" +#define SLASH "\\" +#define streq(a,b) (strcmp(a,b)==0) + +DIR * +opendir(name) +char *name; +{ + register DIR *nd; + char *cwd; + char drive[3]; + int atroot = 0; + int rooted = 0; + + /* + * hack off drive designator if present + */ + + if (name[1] == ':') { + cwd = getdcwd(toupper(name[0]) - 'A' + 1); + drive[0] = name[0]; drive[1] = ':'; drive[2] = '\0'; + name += 2; + } + else { + cwd = getdcwd(0); + drive[0] = '\0'; + } + + /* is the name 'rooted'? */ + if ((*name == '/') || (*name == '\\')) ++rooted; + + /* see if we are at the root directory for this device */ + if (!*cwd) ++atroot; + + /* + * MSDOS '/' doesn't have a '.' or '..' + * also, double '/' sequences don't make sense. + * many ported programs expect them to work, so we fix it up... + */ + + /* chop off leading . and .. if at root */ + if (atroot && (*name == '.')) { + switch (*++name) { + case '\0': + case '/': + case '\\': + break; + + case '.': + switch (*++name) { + case '\0': + case '/': + case '\\': + break; + default: + --name; + --name; + } + break; + + default: + --name; + } + } + + /* chop off leading /'s, /.'s and /..'s to make naming sensible */ + while (*name && ((*name == '/') || (*name == '\\'))) { + if (*++name == '.') { + switch (*++name) { + case '\0': + case '/': + case '\\': + break; + + case '.': + switch (*++name) { + case '\0': + case '/': + case '\\': + break; + + default: + --name; + --name; + } + break; + + default: + --name; + } + } + } + + + /* + * name should now look like: path/path/path + * we must now construct name based on whether or not it + * was 'rooted' (started with a /) + */ + + if (rooted) cwd = ""; + + /* construct DIR */ + if (!(nd = (DIR *)malloc( + sizeof(DIR)+strlen(drive)+strlen(cwd)+strlen(SLASH)+ + strlen(name)+strlen(SUFFIX)))) + return (DIR *) 0; + + /* create long name */ + strcpy(nd->dd_name, drive); + if (*cwd) { + strcat(nd->dd_name, SLASH); + strcat(nd->dd_name, cwd); + } + if (*name) { + strcat(nd->dd_name, SLASH); + strcat(nd->dd_name, name); + } + strcat(nd->dd_name, SUFFIX); + + /* search */ + if (!findfirst(&nd->dd_name[0], &nd->dd_dta)) { + free((char *)nd); + errno = ENOENT; + return (DIR *) 0; + } + nd->dd_stat = 0; + return nd; +} + + +struct dirent * +readdir(dirp) +DIR *dirp; +{ + static struct dirent dir; + + if (dirp->dd_stat) + return (struct dirent *) 0; + + /* format structure */ + dir.d_ino = 0; /* not valid for DOS */ + dir.d_reclen = 0; + strcpy(dir.d_name, dirp->dd_dta.name); + dir.d_namlen = strlen(dir.d_name); + strlwr(dir.d_name); /* DOSism */ + + /* read ahead */ + if (findnext(&dirp->dd_dta) != NULL) + dirp->dd_stat = 0; + else + dirp->dd_stat = find_err; + + return &dir; +} + + +void +closedir(dirp) +DIR *dirp; +{ + free((char *)dirp); +} + + +void +seekdir(dirp, pos) +DIR *dirp; +long pos; +{ + /* + * check against DOS limits + */ + + if ((pos < 0) || (pos > 4095)) { + dirp->dd_stat = 1; + return; + } + + *(short *)&dirp->dd_dta.fcb[13] = pos + 1; + + /* read ahead */ + if (findnext(&dirp->dd_dta)) + dirp->dd_stat = 0; + else + dirp->dd_stat = find_err; +} + + +long +telldir(dirp) +DIR *dirp; +{ + return (long) (*(short *)&dirp->dd_dta.fcb[13] - 2); +} diff --git a/dmake/msdos/dosdta.h b/dmake/msdos/dosdta.h new file mode 100644 index 000000000000..c9642715d937 --- /dev/null +++ b/dmake/msdos/dosdta.h @@ -0,0 +1,16 @@ +#ifndef _DOSDTA_ +#define _DOSDTA_ + +#include "stdmacs.h" +typedef struct { + char fcb[21]; + char attr; + short time; + short date; + long size; + char name[13]; +} DTA; + +extern DTA *findfirst ANSI((char *, DTA *)); +extern DTA *findnext ANSI((DTA *)); +#endif diff --git a/dmake/msdos/dstrlwr.c b/dmake/msdos/dstrlwr.c new file mode 100644 index 000000000000..64027eb36481 --- /dev/null +++ b/dmake/msdos/dstrlwr.c @@ -0,0 +1,49 @@ +/* RCS $Id: dstrlwr.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Rotines for computing case mappings in Win95/NT environments. +-- +-- DESCRIPTION +-- This code is an attempt at providing sane case mappings to help +-- deal with the disparity in file name case between 8.3 and long +-- file names under Win95/NT. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#include "extern.h" + +PUBLIC void +dstrlwr(entry, target) +char *entry; +char *target; +{ + char *p; + + if (STOBOOL(DcacheRespCase)) + return; + + /* Look for the target being lower case, if so then lower the case + * of the directory entry. Note that we only check the first + * character of the target. This is a bit of a kludge but there is + * really no other way to know, particularly since this test will be + * performed for each member of the directory but against the same + * target. */ + if (islower(*target)) + strlwr(entry); + + return; +} diff --git a/dmake/msdos/exec.asm b/dmake/msdos/exec.asm new file mode 100644 index 000000000000..db745aece6b2 --- /dev/null +++ b/dmake/msdos/exec.asm @@ -0,0 +1,1234 @@ +; +; DESCRIPTION +; This code is a model independent version of DOS exec that will swap +; the calling process out to secondary storage prior to running the +; child. The prototype for calling the exec function is below. +; +; exec( int swap, char far *program, char far *cmdtail, +; int environment_seg, char far *tmpfilename ); +; +; +; To assemble this file issue the command: +; +; tasm /mx /t /dmmodel exec.asm +; +; where 'model' is one of {small, compact, medium, large}, you may +; also use MASM 5.1 to assemble this file, in this case simply replace +; 'tasm' with 'masm' in the above command line. +; +; AUTHOR +; Dennis Vadura, dvadura@watdragon.uwaterloo.ca +; CS DEPT, University of Waterloo, Waterloo, Ont., Canada +; +; COPYRIGHT +; Copyright (c) 1990 by Dennis Vadura. All rights reserved. +; +; This program is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License +; (version 1), as published by the Free Software Foundation, and +; found in the file 'LICENSE' included with this distribution. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warrant of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program; if not, write to the Free Software +; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +; +ifdef have286 + .286 ; define have286 with -D for 80286 processor or better + mpusha Macro + pusha + Endm + + mpopa Macro + popa + Endm + +else ; 8088/8086 compatible + mpusha Macro + push ax + push cx + push dx + push bx + push sp + push bp + push si + push di + Endm + + mpopa Macro + pop di + pop si + pop bp + add sp,2 + pop bx + pop dx + pop cx + pop ax + Endm +endif + +ifdef msmall + .model small +argbase equ 4 +endif +ifdef mcompact + .model compact +argbase equ 4 +endif +ifdef mmedium + .model medium +argbase equ 6 +endif +ifdef mlarge + .model large +argbase equ 6 +endif +a_swap equ <bp+argbase+0> +a_prog equ <bp+argbase+2> +a_tail equ <bp+argbase+6> +a_env equ <bp+argbase+10> +a_tmp equ <bp+argbase+12> + +a_handle equ <bp+argbase> + + +; Define all useful equ's +swap_xms equ 0 ; we swapped it out to xms +swap_ems equ 2 ; we swapped it out to ems +swap_file equ 4 ; we swapped it out to a file +seg_no_alloc equ 0 ; this is part of a segment +seg_alloc equ 1 ; this is a full segment header +seg_data equ 2 ; this is data for part of a segment + + +; Define any global/external variables that we will be accessing from here. + .data + extrn _errno:word ; Set to dos ret code from exec + public _Interrupted ; Set to 1 if interrupted 0 +_Interrupted dw 0 ; otherwise + + .code + assume cs:@code, ds:@code, ss:@code, es:@code + + even +execstack dw 64 dup (?) ; put the temporary exec stack right +exec_sp label word ; at the start. + +old_ss dw ? ; save stack seg across exec +old_sp dw ? ; save stack ptr across exec +progsize dw ? ; original size of the program +rootsize dw ? ; size of base root kept during swap +resend dw ? ; paragraph where resident code ends +envseg dw ? ; paragraph of environment segment +psp dw ? ; our own psp +swap dw ? ; swapping selection flag +eretcode dw ? ; return code from exec +interrupted dw ? ; interrupted flag for exec +arenahead dw ? ; start of memory block list +alstr dw ? ; allocation strategy save spot +in_exec dw 0 ; flag, 1 ==> in exec + +cmdpath db 65 dup(?) ; file to exec +cmdtail db 129 dup(?) ; its command tail +fcb db 37 dup(0) ; dummy fcb +tmpseg db 7 dup(?) ; block header buffer + +tmpname db 65 dup(0) ; name of temporary file resource + + even +tmphandle dw ? ; handle for temporary file +real_21h dd 0 ; will be DOS's 21h vector if doing -C + +std_fil_handle dw ? ; file handle for -C file +std_fil_number db ? ; system file number for -C file +our_stdout db ? ; sys file number our stdout handle + +error_rhdr db "exec: Failure reading header block", 0DH, 0AH, '$' +error_rseg db "exec: Failure reading segment data", 0DH, 0AH, '$' +error_resize db "exec: Failure on resize", 0DH, 0AH, '$' +error_free db "exec: Failure to free a block", 0DH, 0AH, '$' +error_string db "exec: Program swap failure", 0DH, 0AH, '$' +error_alloc db "exec: Memory blocks don't match", 0DH, 0AH, '$' + + even +write_header label word + whdr_xms_ptr dw word ptr whdr_xms + whdr_ems_ptr dw word ptr whdr_ems + whdr_file_ptr dw word ptr whdr_file + +write_seg label word + wseg_xms_ptr dw word ptr wseg_xms + wseg_ems_ptr dw word ptr wseg_ems + wseg_file_ptr dw word ptr wseg_file + +read_header label word + rhdr_xms_ptr dw word ptr rhdr_xms + rhdr_ems_ptr dw word ptr rhdr_ems + rhdr_file_ptr dw word ptr rhdr_file + +read_seg label word + rseg_xms_ptr dw word ptr rseg_xms + rseg_ems_ptr dw word ptr rseg_ems + rseg_file_ptr dw word ptr rseg_file + +free_resource label word + free_xms_ptr dw word ptr free_xms_resource + free_ems_ptr dw word ptr free_ems_resource + free_file_ptr dw word ptr free_file_resource + +reset_resource label word + reset_xms_ptr dw word ptr reset_xms_resource + reset_ems_ptr dw word ptr reset_ems_resource + reset_file_ptr dw word ptr reset_file_resource + +old_ctl_brk label dword + old_ctl_brk_off dw ? + old_ctl_brk_seg dw ? + +old_crit_err label dword + old_crit_err_off dw ? + old_crit_err_seg dw ? + +exec_block label word + ex_envseg dw ? ; env seg, use parent's if 0 + ex_cmdtail dd ? ; command tail for exec + ex_fcb1 dd far ptr fcb ; fcb's aren't used by dmake + ex_fcb2 dd far ptr fcb + ex_ss dw ? ; saved ss for exec + ex_sp dw ? ; saved sp for exec + ex_error dw 0 ; error code for dos exec + + +; Special 21h (DOS call) handler to tee stdout/stderr writes to the -C file. +; Ignore 21h calls that aren't writes to 1 or 2; i.e., pass them to DOS handler. +; If write call was from this process, it's pretty simple to duplicate it +; to the -C file. If it's from another process, we try to write to its +; inherited handle. Worst case is where the handle wasn't inherited: someone +; closed it. In that instance we have to switch to dmake's PSP to do the +; duplicate write. + +; Subprocesses do not get their stdout/stderr teed to the -C file if +; their stdout/stderr no longer points to the file/device that dmake's +; stdout points to. This is tested by looking at the process's job +; file table, which is a table that maps process handles to DOS system file +; table numbers. (The far pointer to the JFT is at the PSP offset 34h.) +; The JFT is also queried to see if the -C file was inherited. + +; O_BINARY, O_TEXT problems are ignored here. These are fudged by the +; C library before it calls DOS; since we're working below that level +; we don't have to worry about it. + +simulate_21h Macro + pushf ;; direct call to DOS + call cs:[real_21h] + Endm + + assume cs:@code, ds:nothing, es:nothing, ss:nothing +our_21h_handler proc far + pushf + cmp ah,40h ; is this a write? + jne call_dos ; --no + cmp bx,1 ; write on handle 1 (stdout?) + je duplicate_it + cmp bx,2 ; stderr? + je duplicate_it + +call_dos: + popf + jmp [real_21h] ; far jump to real handler, which will do the sys call + ; and return to the original caller + +duplicate_it: + mpusha + push ds + push es + mov bp,sp + + mov di,std_fil_handle ; handle of the -C file + + If @CodeSize eq 0 + ; Small/compact models allow for quick test of us versus subprocess. + ; False negative (it's us with a different CS) will be picked + ; up by code just below. (Might happen due to call from C library.) + ; False positives would be bad, but can't happen. + mov ax,[bp+24] ; caller's CS + cmp ax,@code ; same as us? + je call_from_dmake + Endif + + mov ah,51h ; get PSP ("undocumented version" works in DOS 2.0+) + simulate_21h ; PSP segment returned in BX + cmp bx,psp ; our PSP? + je call_from_dmake ; --yes, no PSP changing needed + + mov es,bx ; set ES to current (caller's) PSP + lds bx,es:[34h] ; set DS:BX pointing to caller's job file table + + mov si,[bp+12] ; file handle caller passed in (known to be 1 or 2) + mov al,[bx+si] ; system file number corresponding to caller's handle + cmp al,our_stdout ; same as our stdout? + jne do_real_write ; no--subprocess must have redirected it + + mov al,[bx+di] ; see if caller has dup of -C file still open + cmp al,std_fil_number + je use_dup ; yes--we can write using caller's PSP + + ; Calling process (or some intermediate process) has closed + ; the -C descriptor. We'll use dmake's (our) -C descriptor, but + ; to do so we'll have to change the PSP. Disable BREAK handling + ; so that ^break doesn't kill the wrong process. + + mov ax,3300h ; get BREAK flag + simulate_21h + mov si,dx ; save BREAK state in SI + sub dx,dx ; now turn break flag off + mov ax,3301h + simulate_21h ; don't want ^Break recoginized while PSP changed + mov bx,psp ; set dmake's PSP + mov ah,50h + simulate_21h + + mov bx,di ; handle of -C file + ; CX still has caller's count + mov ds,[bp+2] ; restore caller's DS + mov dx,[bp+14] ; DS:DX again points to caller's buffer + mov ah,40h + simulate_21h ; write the copy + + mov bx,es ; caller's PSP + mov ah,50h ; set PSP + simulate_21h ; restore caller's PSP + mov dx,si ; break state before we changed it + mov ax,3301h + simulate_21h ; restore break state + + jmp short do_real_write + +use_dup: + mov ds,[bp+2] ; restore caller's DS + mov dx,[bp+14] ; DS:DX again points to caller's buffer + +call_from_dmake: + mov bx,di ; handle of -C file + mov ah,40h ; write + ; CX still has caller's count + simulate_21h ; write to the file + +do_real_write: + pop es + pop ds + mpopa + popf + jmp [real_21h] ; far jump to real handler, which will do the sys call + ; and return to the original caller +our_21h_handler endp + + assume cs:@code, ds:@code, ss:@code, es:@code + +;----------------------------------------------------------------------------- +; First define the critical-error and control-brk handlers. +; The critical error handler simply pops the machine state and returns an +; access denied result code. +crit_err_handler proc far + add sp, 6 ; ip/cs/flags ... + pop ax + pop bx + pop cx + pop dx + pop si + pop di + pop bp + pop ds + pop es + push bp ; fix up the return flags + mov bp, sp + xchg ax, [bp+6] ; get the flag byte. + or ax, 1 ; set the carry bit + xchg ax, [bp+6] ; put it back. + pop bp + mov ax, 5 ; access denied + iret +crit_err_handler endp + + +;----------------------------------------------------------------------------- +; Here we set the interrupted flag, and terminate the currently running +; process. +ctl_brk_handler proc far + clc ; make sure carry is clear + inc cs:interrupted ; set the flag + +; Make certain it isn't us that is going to get terminated. +; There is a small window where the in_exec flag is set but the child is +; not running yet, I assume that DOS doesn't test for ctl_brk at that time +; as it is bussily creating a new process. + cmp cs:in_exec,0 + je just_return ; note this implies CF == 0 + stc ; set CF to abort child +just_return: iret +ctl_brk_handler endp + + +;----------------------------------------------------------------------------- +; Something really nasty happened, so abort the exec call and exit. +; This kills the calling process altogether, and is a very nasty way of +; termination since files may still be open etc. +abort_exec_rhdr label near + mov dx, offset error_rhdr + jmp print_it +abort_exec_rseg label near + mov dx, offset error_rseg + jmp print_it +abort_exec_resize label near + mov dx, offset error_resize + jmp print_it +abort_exec_free label near + mov dx, offset error_free + jmp print_it +abort_exec_alloc label near + mov dx, offset error_alloc + jmp print_it +abort_exec proc near + mov dx, offset error_string +print_it: push dx + mov bx, [swap] + call [free_resource+bx] + mov ax, cs + mov ds, ax + pop dx + mov ah, 9 + int 21H +kill_program: mov ax, 04cffH ; nuke it! + int 21H +abort_exec endp + + +;----------------------------------------------------------------------------- +; lodsw/stosw loop to copy data. Called only for word copy operations. +; ds:si - point at source +; es:di - point at destination +; cx - count of bytes to copy. +copy_data proc near + shr cx, 1 ; convert to word count + jnc copy_words + movsb +copy_words: rep movsw ; copy the words. + ret +copy_data endp + + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ XMS RECORDS. +;============================================================================= +rhdr_xms proc near + ret +rhdr_xms endp + +rseg_xms proc near + ret +rseg_xms endp + +reset_xms_resource proc near + ret +reset_xms_resource endp + +free_xms_resource proc near + ret +free_xms_resource endp +;============================================================================= + + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ EMS RECORDS. +;============================================================================= +rhdr_ems proc near + ret +rhdr_ems endp + +rseg_ems proc near + ret +rseg_ems endp + +reset_ems_resource proc near + ret +reset_ems_resource endp + +free_ems_resource proc near + ret +free_ems_resource endp +;============================================================================= + + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO READ FILE RECORDS. +;============================================================================= +; This routine reads a segment header from a file. +; The header is a seven byte record formatted as follows: +; segment address - of data +; offset address - of data +; length in paragraphs - of data +; mode - 1 => segment header (allocate seg on read) +; 0 => subsegment, don't allocate on read. +; The information is placed into the tmpseg data area in the code segment. +; The routine aborts if an error is detected. +rhdr_file proc near + mov dx, offset tmpseg ; read the header record out + mov cx, 7 + mov bx, [tmphandle] + mov ah, 03fH + int 21H + jnc rhdr_done ; make sure it worked + jmp abort_exec_rhdr + +rhdr_done: cmp ax, 7 + je exit_rhdr_file + or ax, ax + je signal_eof + jmp abort_exec_rhdr + +signal_eof: stc +exit_rhdr_file: ret +rhdr_file endp + + +;----------------------------------------------------------------------------- +; Read a segment from the temporary file whose handle is in cs:tmphandle. +; The routine aborts if an error is detected. +rseg_file proc near + push ds + mov ds, word ptr cs:tmpseg; Now read the whole segment + mov dx, word ptr cs:tmpseg+2 + mov cx, word ptr cs:tmpseg+4 + mov bx, cs:tmphandle + mov ah, 03fH + int 21H + pop ds + jnc rseg_done + jmp abort_exec_rseg + +rseg_done: cmp ax, [word ptr tmpseg+4] + je exit_rseg_file + jmp abort_exec_rseg ; If we didn't get read full +exit_rseg_file: ret ; segment then abort +rseg_file endp + + +;----------------------------------------------------------------------------- +; Seek to the beginning of the file. +reset_file_resource proc near + mov bx, [tmphandle] + xor cx, cx + mov dx, cx + mov ax, 04200H ; seek to begining of file + int 21H + ret +reset_file_resource endp + + +;----------------------------------------------------------------------------- +; unlink the temporary file allocated for swapping. +; We close the file first, and then delete it. We ignore errors here since +; we can't do anything about them anyway. +free_file_resource proc near + mov bx, [tmphandle] ; get the file handle + mov ah, 03eH ; close the file + int 21H + mov dx, offset tmpname ; Now delete the temp file + mov ah, 041H + int 21H + ret +free_file_resource endp +;============================================================================= + + + +;============================================================================= +; CODE TO SWAP THE IMAGE IN FROM SECONDARY STORAGE +;============================================================================= +swap_in proc near + mov bx, [alstr] ; get previous alloc strategy + mov ax, 5801H ; and set it back + int 21H + mov bx, [swap] ; get type of resource + call [reset_resource+bx] ; reset the resource + mov es, [psp] ; resize the program back + mov bx, [progsize] ; to original size + mov ah, 04AH + int 21H + jnc read_seg_loop + jmp abort_exec + +read_seg_loop: mov bx, [swap] ; get type of resource + call [read_header+bx] ; get seg header + jc exit_swap_in ; all done + mov al, [tmpseg+6] + cmp al, seg_no_alloc ; see if dummy segment header + je read_seg_loop + cmp al, seg_alloc ; do we need to do an alloc? + jne read_data ; nope + +; Allocate back the memory for a segment that is not the [psp], note that this +; must come back to the same segment we had previously since other segments +; may have pointers stored in their variables that point to this segment using +; segment:offset long pointers. + mov bx, [word ptr tmpseg+4] ; get count of paragraphs + mov ah, 048H ; dos_alloc + int 21H + jc alloc_error ; oops! + cmp ax, [word ptr tmpseg] ; did we get the same segment? + je read_seg_loop ; yup! +alloc_error: jmp abort_exec_alloc + +read_data: mov bx, [swap] + call [read_seg+bx] ; this must succeed, if fail + jmp read_seg_loop ; we never come back here + +exit_swap_in: mov bx, [swap] ; all done, so free resource + call [free_resource+bx] + ret +swap_in endp + + +;============================================================================= +; CODE TO SWAP THE IMAGE OUT TO SECONDARY STORAGE +;============================================================================= +; This routine is called to swap the non-resident portion of the program +; out to the resource specified by the value of [cs:swap]. If the swap out +; fails, then appropriate routines are called to free the resources allocated +; up to that point. +; +; The steps used to swap the program out are as follows: +; - calculate new size of program to remain resident and size to swap +; out. +; - write out non-resident portion of current segment +; - walk DOS allocation chain and write out all other segments owned by +; the current program that are contiguous with the _psp segment +; - copy the environment down to low memory +; - resize the current _psp segment to savesize +; - free all segments belonging to program except current _psp segment +swap_out proc near + mov ax, 05800H ; get memory alocation strategy + int 021H + mov [alstr], ax ; and save it for future restoration. + mov di, [psp] ; compute length of program to current + mov bx, cs ; value of cs, and find program size + sub bx, di ; by looking at length stored in + mov ax, di ; arena header found in front of psp + dec ax + mov es, ax + mov si, es:3 ; si is size of program in paragraphs + mov [progsize], si ; progsize now contains the size. + +; Now compute length of program segment to save. +; Length is: cs - psp + (offset overlay_code_here+15 >> 4) + mov ax, offset overlay_code_here+15 + shr ax, 1 + shr ax, 1 + shr ax, 1 + shr ax, 1 + add bx, ax ; bx is size of program to keep + sub si, bx ; si is # of paragraphs to save. + add di, bx ; di is paragraph to start at + mov rootsize, bx + mov resend, di ; cs:resend is saved start para + mov al, seg_no_alloc ; set no allocation for segment + call write_segment + jc abort_swap_out + +; We have now saved the portion of the program segment that will not remain +; resident during the exec. We should now walk the DOS allocation chain and +; write out all other segments owned by the current process. +save_segments: mov ax, [psp] + dec ax + mov es, ax + mov bx, offset write_segment_data + call walk_arena_chain + jc abort_swap_out + +; Now we must walk the chain of allocated memory blocks again and free +; all those that are owned by the current process, except the one that is +; the current process' psp. +free_segments: mov ax, [psp] + dec ax + mov es,ax + mov bx, offset free_dos_segment + call walk_arena_chain + jnc resize_program + jmp abort_exec_free ; can't fix it up now. + +; We now resize the program to the size specified by cs:rootsize. This will +; free most of the memory taken up by the current program segment. +resize_program: mov es, [psp] ; es is segment to resize. + mov bx, [rootsize] ; bx is size of segment. + mov ah, 04aH ; resize memory block + int 21H + jnc swap_out_ok + jmp abort_exec_resize ; disaster +swap_out_ok: ret + +; The swap out failed for some reason, so free any allocated resources +; and set the carry bit. +abort_swap_out: mov bx, [swap] + call [free_resource+bx] + xor ax, ax + mov [swap], ax ; clear the swap flag + stc + ret +swap_out endp + + +;============================================================================= +; CODE TO SET-UP FOR AND EXEC THE CHILD PROCESS +;============================================================================= +; Actually execute the program. If cs:swap is set, this code will invoke the +; swap-out/swap-in code as required. +do_exec proc near + cmp [swap], 0 ; does the user want to swap? + je no_swap_out ; nope + call init_swap ; figger out where to swap to + jc no_swap_out ; if carry set then don't swap + call swap_out + +no_swap_out: cmp [interrupted], 0 ; were we interrupted? + jne leave_exec ; yep, so clean up, don't exec + +; free passed in environment block if it is non zero. +; This way the parent program does not need to free it. + mov ax, [envseg] + or ax, ax + je setup_block + push ax + mov es, ax + mov ah, 49H + int 21H + pop ax + +; set up the parameter block for the DOS exec call. +; offset contents +; 00 segment address of environment to be passed, +; 0 => use parents env. +; 02 pointer to command tail for new process. +; 06 pointer to fcb1 +; 0a pointer to fcb2 +setup_block: mov ax, [envseg] + mov [ex_envseg], ax + mov cx, cs + mov [word ptr ex_cmdtail], offset cmdtail + mov [word ptr ex_cmdtail+2], cx + +; set up registers for exec call +; ds:dx - pointer to pathname of program to execute +; es:bx - pointer to above parameter block + mov dx, offset cmdpath + mov es, cx + mov bx, offset exec_block + +; Under DOS 2.x exec is notorious for clobbering registers and guarantees +; to preserve only cs:ip. + push ds + mov [ex_sp], sp + mov [ex_ss], ss + mov [ex_error], 0 ; clear exec error code + inc [in_exec] ; set internal flag + mov ax, 04b00H + int 21H + +; returned from exec, so restore possibly clobbered registers. + mov ss, cs:ex_ss + mov sp, cs:ex_sp + pop ds + +; check to make certain the exec call worked. + jnc it_worked + +; exec call failed. Save return code from msdos. + mov [ex_error], ax + jmp leave_exec + +it_worked: mov ah, 04dH ; get the return code + int 21H + cmp ah,1 ; check if terminated by ^C + jnz nosigint + inc interrupted ; yes so set flag +nosigint: xor ah, ah ; 8-bit return code, so clear ah + mov [eretcode], ax + +leave_exec: cmp [swap], 0 ; check swap, if non-zero swap back in + je no_swap_in + call swap_in + +; Clear the in_exec after the swap back in. This way we are guaranteed to +; get parent in and the resources freed should a ^C be hit when we are reading +; the image in. +no_swap_in: mov [in_exec], 0 + ret +do_exec endp + + + +;============================================================================== +; Everything past this point is overwriten with the environment and new +; program after the currently executing program is swapped out. +;============================================================================== +overlay_code_here label word + +;----------------------------------------------------------------------------- +; Figure out where we can swap to and initialize the resource we are going to +; use. We try XMS, EMS, and a tempfile (if specified), in that order. We set +; [cs:swap] to the correct value based on which of the resources exists. +; If none can be used, then [cs:swap] is set to 0, and no swap takes place. +; The exec code will still attempt to execute the child in this instance, but +; may fail due to lack of resources. Each swap_out_* routine must provide +; its own clean-up handler should it not be able to write all program +; segments to the swap resource. +init_swap proc near + mov [swap], 0 +;call init_xms +;jnc init_done +;call init_ems +;jnc init_done + call init_file +init_done: ret +init_swap endp + + +;----------------------------------------------------------------------------- +; This routine is used to walk the DOS allocated memory block chain +; starting at address supplied in the es register. For each block it +; calls the routine specified by the bx register with the segment length +; in si, and its address in di. It does not apply the routine to the +; segment if the segment is the same as the current program's [cs:psp] value. +memheader struc + magic db ? ; either 'Z' for end or 'M' for allocated + owner dw ? ; psp of owner block + len dw ? ; length in paragraphs of segment +memheader ends + +walk_arena_chain proc near + mov si, word ptr es:3 ; get length + mov di, es + inc di + mov ax, word ptr es:1 + +; Stop the search if the block is NOT owned by us. Ignore our own psp block +; and our environment segment block. + cmp ax, cs:psp ; is it owned by us? + jne walk_done ; NOPE! -- all done + cmp di, cs:envseg ; skip our environment + je next_block + cmp di, cs:psp ; skip our psp + je next_block + +; Now save state and call the routine pointed at by [bx]. + push di + push si + push bx + call bx + pop bx + pop si + pop di + jc exit_walk ; if error then stop + mov al, byte ptr es:0 ; check if at end + cmp al, 'Z' + je walk_done + +next_block: add di, si ; go on to next segment + mov es, di + jmp walk_arena_chain +walk_done: clc +exit_walk: ret +walk_arena_chain endp + + +;----------------------------------------------------------------------------- +; This routine takes a dos segment found in the di register and free's it. +free_dos_segment proc near + mov es, di ; free dos memory block + mov ah, 49H + int 21H + ret +free_dos_segment endp + + +;----------------------------------------------------------------------------- +; Called to invoke write_segment with proper values in the al register. Only +; ever called from walk_arena_chain, and so al should be set to seg_alloc. +write_segment_data label near + mov al, seg_alloc ; and fall through into write_segment +;----------------------------------------------------------------------------- +; This routine writes a segment as a block of data segments if the number of +; paragraphs to write exceeds 0x0fff (rarely the case). +; It stuffs the info into tmpseg, and then calls wheader and wseg to get the +; data out. +; +; di:dx segment:offset of segment; offset is ALWAYS zero. +; si number of paragraphs to write. +; al mode of header to write +write_segment proc near + push di + push si + xor dx,dx + mov bx, [swap] + call [write_header+bx] + pop si + pop di + jc exit_wseg + +do_io_loop: cmp si, 0 ; are we done yet? + je exit_wseg ; yup so leave. + mov cx, si ; # of paragraphs to move + cmp cx, 0fffH ; see if we have lots to move? + jle do_io + mov cx, 0fffH ; reset to max I/O size + +do_io: push cx ; save # of paragraphs we are writing + shl cx, 1 ; shift cx by four to the left + shl cx, 1 + shl cx, 1 + shl cx, 1 + push di ; save the start, and count left + push si + mov si, cx + xor dx,dx + mov al, seg_data + mov bx, [swap] + push bx + call [write_header+bx] + pop bx + call [write_seg+bx] + pop si + pop di + pop dx ; original paragraph count in dx + jc exit_wseg ; it failed so exit. + add di, dx ; adjust the pointers, and continue. + sub si, dx + jmp do_io_loop +exit_wseg: ret +write_segment endp + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE XMS RECORDS. +;============================================================================= +init_xms proc near + ret +init_xms endp + +whdr_xms proc near + ret +whdr_xms endp + +wseg_xms proc near + ret +wseg_xms endp +;============================================================================= + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE EMS RECORDS. +;============================================================================= +init_ems proc near + ret +init_ems endp + +whdr_ems proc near + ret +whdr_ems endp + +wseg_ems proc near + ret +wseg_ems endp +;============================================================================= + + +;============================================================================= +; THE FOLLOWING SECTION DEALS WITH ALL ROUTINES REQUIRED TO WRITE FILES. +;============================================================================= +;----------------------------------------------------------------------------- +; Attempt to create a temporary file. If the tempfile name is NIL then return +; with the cary flag set. +init_file proc near + mov al, [tmpname] + or al, al + je err_init_file + mov dx, offset tmpname + xor cx, cx + mov ah, 03cH + int 21H + jc err_init_file ; if carry set then failure + mov [tmphandle], ax ; init swapping + mov [swap], swap_file + jmp exit_init_file +err_init_file: stc +exit_init_file: ret +init_file endp + + +;----------------------------------------------------------------------------- +; This routine writes a segment header to a file. +; The header is a seven byte record formatted as follows: +; segment address - of data +; offset address - of data +; length in paragraphs - of data +; mode - 1 => segment header (allocate seg on read) +; 0 => subsegment, don't allocate on read. +; Routine takes three arguments: +; di:dx segment:offset of segment +; si number of paragraphs to write. +; al mode of header to write +whdr_file proc near + mov [word ptr tmpseg], di ; save the segment/offset + mov [word ptr tmpseg+2], dx + mov [word ptr tmpseg+4], si ; save the segment length + mov [tmpseg+6], al + mov dx, offset tmpseg ; write the header record out + mov cx, 7 + mov bx, [tmphandle] + mov ah, 040H + int 21H + jc exit_whdr_file ; make sure it worked + cmp ax, 7 + je exit_whdr_file ; oh oh, disk is full! +err_whdr_file: stc +exit_whdr_file: ret +whdr_file endp + + +;----------------------------------------------------------------------------- +; Write a segment to the temporary file whose handle is in cs:tmphandle +; Parameters for the write are assumed to be stored in the tmpseg data area. +; function returns carry set if failed, carry clear otherwise. +wseg_file proc near + push ds + mov ds, word ptr cs:tmpseg ; Now write the whole segment + mov dx, word ptr cs:tmpseg+2 + mov cx, word ptr cs:tmpseg+4 + mov bx, cs:tmphandle + mov ah, 040H + int 21H + pop ds + jc exit_wseg_file ; make sure it worked + cmp ax, [word ptr tmpseg+4] + je exit_wseg_file +err_wseg_file: stc ; it failed (usually disk full) +exit_wseg_file: ret +wseg_file endp +;============================================================================= + + +;============================================================================= +; _exec: THIS IS THE MAIN ENTRY ROUTINE TO THIS MODULE +;============================================================================= +; This is the main entry routine into the swap code and corresponds to the +; following C function call: +; +; exec( int swap, char far *program, char far *cmdtail, int environment_seg, +; char far *tmpfilename ); +; +; Exec performs the following: +; 1. set up the local code segment copies of arguments to the exec call. +; 2. switch to a local stack frame so that we don't clobber the user +; stack. +; 3. save old interrupt vectors for ctrl-brk. +; 4. install our own handler for the ctrl-brk interrupt, our handler +; terminates the current running process, and returns with non-zero +; status code. +; 5. get our psp +; 6. setup arguments for exec call +; 7. exec the program, save result code on return. +; 8. restore previous ctrl-brk and crit-error handler. +; 9. restore previous process stack, and segment registers. +; 10. return from exec with child result code in AX +; and global _Interrupted flag set to true if child execution was +; interrupted. + +; NOTE: When first called the segments here assume the standard segment +; settings. + assume cs:@code, ds:DGROUP,es:DGROUP,ss:DGROUP + + public _exec +_exec proc + push bp ; set up the stack frame + mov bp, sp + push si ; save registers we shouldn't step on. + push di + push ds + +; set up for copying of parameters passed in with long pointers. + push cs ; going to use lodsb/stosb, set up es + pop es ; as destination. + assume es:@code ; let the assembler know :-) + cld ; make sure direction is right + +; Copy all parameters into the bottom of the code segment. After doing so we +; will immediately switch stacks, so that the user stack is preserved intact. + mov ax, ss:[a_swap] ; save swap + mov es:swap, ax + mov ax, ss:[a_env] ; save env seg to use + mov es:envseg, ax + + mov di, offset cs:cmdpath ; copy the command + lds si, ss:[a_prog] ; 65 bytes worth + mov cx, 65 + call copy_data + + mov di, offset cs:cmdtail ; copy the command tail + lds si, ss:[a_tail] ; 129 bytes worth + mov cx, 129 + call copy_data + + mov di, offset cs:tmpname ; copy the temp file name + lds si, ss:[a_tmp] ; 65 bytes worth. + mov cx, 65 + call copy_data + +; Now we save the current ss:sp stack pointer and swap stack to our temporary +; stack located in the current code segment. At the same time we reset the +; segment pointers to point into the code segment only. +swap_stacks: mov ax, ss + mov es:old_ss, ax + mov es:old_sp, sp + mov ax, cs + mov ds, ax + mov ss, ax ; set ss first, ints are then + mov sp, offset cs:exec_sp ; disabled for this instr too + assume ds:@code, ss:@code ; let the assembler know :-) + +; Now we save the old control break and critical error handler addresses. +; We replace them by our own routines found in the resident portion of the +; swapping exec code. +set_handlers: mov [interrupted], 0 ; clear interrupted flag + mov [eretcode], 0 ; clear the return code + mov ax, 03523H ; get int 23 handler address + int 21H + mov cs:old_ctl_brk_off, bx + mov cs:old_ctl_brk_seg, es + mov dx, offset ctl_brk_handler + mov ax, 02523H ; set int 23 handler address + int 21H + + mov ax, 03524H ; get int 24 handler address + int 21H + mov cs:old_crit_err_off, bx + mov cs:old_crit_err_seg, es + mov dx, offset crit_err_handler + mov ax, 02524H ; set int 24 handler address + int 21H + +; Go and execute the child, we've set up all of its parameters. The do_exec +; routine will attempt to perform a swap of the code if requested to do so by +; a non-zero value in the variable cs:swap. + mov ah, 051H ; get the psp + int 21H + mov cs:psp, bx + call do_exec + +; We're back from the exec, so fix things up the way they were. +; Restore the old control-break and critical-error handlers. + lds dx, cs:old_ctl_brk + mov ax, 02523H + int 21H + lds dx, cs:old_crit_err + mov ax, 02524H + int 21H + +; Restore previous program stack segment registers, and data segment. + mov ax, cs:old_ss + mov ss, ax ; mov into ss first, that way + mov sp, cs:old_sp ; no interrupts in this instr. + pop ds + +; Tell the assembler we have swaped segments again. + assume ds:DGROUP,es:DGROUP,ss:DGROUP + +; Set the global Interrupted flag so that parent can tell it was interrupted. + mov ax, seg DGROUP:_Interrupted + mov es, ax + mov ax, cs:interrupted + mov es:_Interrupted, ax + +; Set the global errno value to reflect the success/failure of the DOS +; exec call. + mov ax, seg DGROUP:_errno + mov es, ax + mov ax, cs:ex_error + mov es:_errno, ax + +; Fetch the child's return code, pop rest of stuff off of the stack +; and return to the caller. + mov ax, cs:eretcode + pop di + pop si + pop bp + ret +_exec endp + +; void do_hook_std_writes(int handle); +; This saves the 21h interrupt vector and changes it to point +; into this code. Argument is the file handle of the -C file. + + public _do_hook_std_writes +_do_hook_std_writes proc + push bp + mov bp,sp + push di + + mov di, ss:[a_handle] ; handle of -C file + mov std_fil_handle, di + + mov ah, 51h ; request our PSP + int 21h + mov [psp], bx ; save it + + mov es, bx + les bx, es:[34h] ; pointer to job file table + mov al, es:[bx+1] ; system file # of our stdout + mov [our_stdout], al + mov al, es:[bx+di] ; system file number of -C file + mov std_fil_number, al + + mov ax,3521h ; request vector 21h + int 21h ; it's returned in ES:BX + mov word ptr [real_21h], bx + mov word ptr [real_21h+2], es + + push ds + mov ax,cs + mov ds,ax + lea dx,our_21h_handler ; DS:DX is the new vector + mov ax,2521h ; set vector 21h + int 21h + + pop ds + pop di + pop bp + ret +_do_hook_std_writes endp + +; void do_unhook_std_writes(void); +; This restores the 21h interrupt vector. +; The saved vector is zero if it wasn't changed (no -C option). + + public _do_unhook_std_writes +_do_unhook_std_writes proc + push ds + + lds dx, [real_21h] ; put saved vector into DS:DX + mov ax, ds + or ax, dx + jz unhook_return ; zero means we didn't hook 21h + + mov ax,2521h ; set vector 21h + simulate_21h + +unhook_return: pop ds + ret +_do_unhook_std_writes endp +end diff --git a/dmake/msdos/exec.h b/dmake/msdos/exec.h new file mode 100644 index 000000000000..f603bc43d2cb --- /dev/null +++ b/dmake/msdos/exec.h @@ -0,0 +1,43 @@ +/* RCS $Id: exec.h,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Internal version of exec for dmake. +-- +-- DESCRIPTION +-- External defines for the exec.c code. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#ifndef _EXEC_h_ +#define _EXEC_h_ + +#ifndef ANSI +#if defined(__STDC__) || defined(__TURBOC__) +#define ANSI(x) x +#else +#define ANSI(x) () +#endif +#endif + +extern int exec ANSI((int, char far *, char far *, unsigned int, char far *)); + +#ifndef MK_FP +#define MK_FP(seg,ofs) \ + ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(ofs))) +#endif + +#endif diff --git a/dmake/msdos/exec.uue b/dmake/msdos/exec.uue new file mode 100644 index 000000000000..90a1c3e661e8 --- /dev/null +++ b/dmake/msdos/exec.uue @@ -0,0 +1,63 @@ +begin 777 exec.obj +M@! #DU31$]37&5X96,N87-M;(@@ '%1U<F)O($%S<V5M8FQE<B @5F5R +M<VEO;B S+C";B!8 0.DJ<T$=#DU31$]37&5X96,N87-M.H@# $#I3)8" !H +MB , 0*&4EA "45814-?5$585 1#3T1%:9@' $@:" (# ?&6# %7T1!5$$$ +M1$%40<*8!P!( @ $!0$-E@@ !D1'4D]54(N:! &_P);C D !E]E<G)N;P#@ +MD!, 0(,7TEN=&5R<G5P=&5D 69 < !%5]D;U]U;FAO;VM?<W1D7W=R +M:71E<P,( &>0# 05?97AE8^$& '.0&@ 1-?9&]?:&]O:U]S=&1?=W)I +M=&5SN < FH@$ $"B 9&@!@ !F ,&B#@ !7 $E $ 0 $ RJ(. &( +M 4$ 0 ! 0""H@X <D! 0 ! $ ! (&@" !S $ BJ#' '4 +M 65X96,Z($9A:6QU<F4@<F5A9&EN9R!H96%D97(@8FQO8VL-"B1E>&5C.B!& +M86EL=7)E(')E861I;F<@<V5G;65N="!D871A#0HD97AE8SH@1F%I;'5R92!O +M;B!R97-I>F4-"B1E>&5C.B!&86EL=7)E('1O(&9R964@82!B;&]C:PT*)&5X +M96,Z(%!R;V=R86T@<W=A<"!F86EL=7)E#0HD97AE8SH@365M;W)Y(&)L;V-K +M<R!D;VXG="!M871C: T*)+>B#@ !EP(! $ 0 $ LJ H &8 G(&=0:7 +M!G,&=@:]!@,$!P0+! 0$" 0J! 8$"@1@! 4$"012! J<20#$ %0!Q )4 <0$ +M5 '$!E0!Q A4 <0*5 '$#%0!Q Y4 <005 '$$E0!Q!14 <065 '$&%0!Q!I4 +M <0<5 '$'E0!Q"!4 <0B5 $GH P <H"7 $ %P! #-G D S !4 <P$5 $5 +MH,T# =8" "<@/Q =0J#^P%T"X/[ G0&G2[_+LP!4%%24U155E<>!HOL+HL^ +MT &T49PN_Q[, 2X['HP =&R.PR;%'C0 BW8,B@ N.@;3 75CB@$N.@;2 71* +MN SG"[_'LP!B_(KTK@!,YPN_Q[, 2Z+'HP M%"<+O\>S &+WXY> HM6#K1 +MG"[_'LP!C,.T4)PN_Q[, 8O6N $SG"[_'LP!ZQ".7@*+5@Z+W[1 G"[_'LP! +M!Q]?7EV#Q );6EE8G2[_+LP!@\0&6%M96EY?71\'58OLAT8�$ AT8&7;@% +M ,_X+O\&D@ N@SZ8 !T ?G/NM0!ZQR0NOD!ZQ:0NAX"ZQ"0NC@"ZPJ0NG4" +MZP20NE@"4HL>C@#_E[ "C,B.V%JT"<TAN/],S2'1Z7,!I/.EP\/#P\/#P\/# +MNH$!N0< BQ[* ;0_S2%S NNF/0< = <+P'0"ZYOYPQXNCAZ! 2Z+%H,!+HL. +MA0$NBQ[* ;0_S2$?<P+K@3L&A0%T ^EX_\.+'LH!,\F+T;@ 0LTAPXL>R@&T +M/LTANH@!M$'-(<.+'I8 N %8S2&+'HX _Y>V HX&C "+'H0 M$K-(7,#Z4__ +MBQZ. /^7I )R**"' 3P =.\\ 743BQZ% ;1(S2%R!CL&@0%TV^DA_XL>C@#_ +MEZH"Z\Z+'HX _Y>P L.X %C-(:.6 (L^C ",RRO?B\=(CL FBS8# (DVA "X +MYP71Z-'HT>C1Z /8*_,#^XD>A@")/H@ L #H'0%R,:&, $B.P+LD!NC+ '(C +MH8P 2([ NQT&Z+T <P/IJ_Z.!HP BQZ& +1*S2%S ^F4_L.+'HX _Y>P C/ +MHXX ^<.#/HX '0(Z(, <@/H<_^#/I( '5FH8H "\!T"%".P+1)S2%8H8H +MH\0"C,G'!L8"VP")#L@"NIH CL&[Q (>B2;4 HP6T@+'!M8" #_!I@ N !+ +MS2$NCA;2 BZ+)M0"'W,&H]8"ZQ.0M$W-(8#\ 74$_P:2 #+DHY @SZ. !T +M ^B?_L<&F ,/'!HX #HE@##)HLV P",QT<FH0$ +CL&C !U)BX[/HH +M=!DN.SZ, '025U93_]-;7E]R#R:@ \6G0& _Z.Q^O'^,..Q[1)S2'#L %7 +M5C/2BQZ. /^7F )>7W(Z@_X =#6+SH'Y_P]^ [G_#U'1X='AT>'1X5=6B_$S +MTK "BQZ. %/_EY@"6_^7G@)>7UIR!@/Z*_+KQL/#P\/#P\.@B $*P'07NH@! +M,\FT/,TA<@RCR@''!HX ! #K I#YPXD^@0&)%H,!(YR1 <065 '$)U0!Q"]4 +M <0T5 '$1U0!Q%!4 <1;5 '$:%0!Q&U4 <1U5 '$A50!Q(]4 <2:5 '$K%0! +MQ+Y4 <3A5 '$YE0!Q.Y4 <3T5 '$^E0!Q0!4 <4&5 '%#%0!Q1%4 <455 '% +M-E0!Q3U4 <585 '%750!Q6)4 <5G5 '%=%0!Q7Y4 <6,5 '%DU0!Q9Q4 <6E +M5 '%J50!Q:U4 <6Q5 '%OE0!Q<)4 <7'5 '%TU0!Q=U4 <865 '&/%0!QDI4 +M <7F5 '%ZE0!Q?!4 <7T5 '%_50!Q@%4 <835 '&*%0!QBQ4 <8V5 '&1%0! +MQE94 <9:5 '&:%0!QFQ4 <9Q5 '&=U0!QH94 <:,5 '&FU0!QIY4 <:D5 '& +MIE0!QJI4 <:M5 '&LE0!QK=4 <:[5 '&OU0!QL54 <;/5 '&U%0!QMI4 <;J +M5 '&[U0!QO-4 <;]5 ''!%0!QQM4 <<B5 ''*50!QU94 <=:5 ''@U0!QXA4 +M <>-5 ''HE0!QZE4 <>T5 ''N%0!Q\-4 <?'5 $%H'\! 9\&B3:% :*' ;J! +M ;D' (L>R@&T0,TA<@8]!P!T ?G#'BZ.'H$!+HL6@P$NBPZ% 2Z+'LH!M$#- +M(1]R!SL&A0%T ?G#58OL5E<>#@?\BT8&)J.. (M&$":CB@"_F@#%=@BY00#H +M]_R_VP#%=@RY@0#HZ_R_B '%=A*Y00#HW_R,T":C@ FB2:" (S(CMB.T+R +M ,<&D@ ,<&D +@C-<TA+HD>O (NC :^ KJS [@C)<TAN"0US2$NB1[ +M BZ,!L("NI8#N"0ES2&T4<TA+HD>C #HU?TNQ1:\ K@C)<TA+L46P *X)"7- +M(2ZA@ ".T"Z+)H( '[@ ([ +J&2 ":C "X ".P"ZAU@(FHP +J&0 %]> +M7<M5B^Q7BWX&+HD^T &T4<TA+HD>C ".PR;$'C0 )HI' 2ZBTP$FB@$NHM(! +MN"$US2$NB1[, 2Z,!LX!'HS(CMBZV *X(27-(1]?7<L>+L46S &,V O"= FX +M(26<+O\>S $?RPJ<O0#$ E0!Q 54 <0(5 '$#U0!Q")4 <0G5 '$+%0!Q#%4 +M <0\5 '$4%0!Q%=4 <1:5 '$9E0!Q')4 <2!5 '$AE0!Q(]4 <235 '$F50! +MQ*54 <2J5 '$K50!Q+Q4 <3!5 '$Q%0!Q-)4 <3:5 '$Y%0!Q.U4 <3T5 '( +M^!0! L3^5 '% A0! LD%%@$!Q0M4 <4/%@$!Q1-4 <4C5 '%+%0!Q3M4 <5" +E5 '%3%0!Q5%4 <595 '%:%0!Q7=4 ?6@!@ " %B* @ =%0! + +end diff --git a/dmake/msdos/find.c b/dmake/msdos/find.c new file mode 100644 index 000000000000..d35cc477ec9e --- /dev/null +++ b/dmake/msdos/find.c @@ -0,0 +1,130 @@ +/* + Directory Access Library + + FIND.C taken from DIRLIB.C by M. J. Weinstein + Released to public domain 1-Jan-89 + + The author may be contacted at: + matt@cs.ucla.edu -or- POB 84524, L.A., CA 90073 + + Modified by dvadura@watdragon.edu to work with dmake. + (nuked the DOS version 2 code, since dmake needs version + 3.0 or greater to function). + */ + + +/* + * revision history: + * + * VER MM/DD/YY COMMENTS + * ---- -------- -------- + * 0.99 02/24/86 Beta release to INTERNET + */ + +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include <errno.h> +#include <string.h> +#include <alloc.h> +#include <dos.h> +#include "dosdta.h" + +#ifndef MK_FP +#define MK_FP(seg,ofs) ((void far *) \ + (((unsigned long)(seg) << 16) | (unsigned)(ofs))) +#endif +#ifndef FP_SEG +#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16)) +#endif +#ifndef FP_OFF +#define FP_OFF(fp) ((unsigned)(fp)) +#endif + +int find_err; + +/* + * get/set dta address + */ + +static DTA far * +_getsetdta(newdta) +DTA far *newdta; +{ + DTA far *olddta; + union REGS r; + struct SREGS s; + + /* get old dta */ + r.h.ah = 0x2f; + intdos(&r, &r); + segread(&s); + olddta = (DTA far *) MK_FP(s.es, r.x.bx); + + /* conditionally set new dta */ + if (newdta) { + r.h.ah = 0x1a; + s.ds = FP_SEG(newdta); + r.x.dx = FP_OFF(newdta); + intdosx(&r, &r, &s); + } + + return olddta; +} + +/* + * dos findfirst + */ + +DTA * +findfirst(name, dta) +char *name; +DTA *dta; +{ + union REGS r; + struct SREGS s; + DTA far *dtasave; + char far *nmp = (char far *)name; + + dtasave = _getsetdta((DTA far *)dta); + + /* do directory lookup */ + segread(&s); + r.h.ah = 0x4e; + r.x.cx = 0x10; + r.x.dx = FP_OFF(nmp); + s.ds = FP_SEG(nmp); + intdosx(&r, &r, &s); + /* restore dta */ + _getsetdta(dtasave); + find_err = r.x.ax; + if (r.x.cflag) + return(NULL); + + return dta; +} + +/* + * dos findnext + */ + +DTA * +findnext(dta) +DTA *dta; +{ + union REGS r; + DTA far *dtasave; + + dtasave = _getsetdta((DTA far *)dta); + + /* do directory lookup */ + r.h.ah = 0x4f; + intdos(&r, &r); + /* restore old dta */ + _getsetdta(dtasave); + find_err = r.x.ax; + if (r.x.cflag) + return(NULL); + + return dta; +} diff --git a/dmake/msdos/microsft/config.h b/dmake/msdos/microsft/config.h new file mode 100644 index 000000000000..da2d7cbfc31f --- /dev/null +++ b/dmake/msdos/microsft/config.h @@ -0,0 +1,77 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:29 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#if defined (_MSC_VER) +# if _MSC_VER < 500 + Force a compile-time blowup. + Do not define "#define _MSC_VER" for MSC compilers earlier than 5.0. +# endif +#endif + +/* define this for configurations that don't have the coreleft function + * so that the code compiles. To my knowledge coreleft exists only on + * Turbo C, but it is needed here since the function is used in many debug + * macros. */ +#define coreleft() 0L + +/* MSC Version 4.0 doesn't understand SIGTERM, later versions do. */ +#ifndef SIGTERM +# define SIGTERM SIGINT +#endif + +/* Fixes unimplemented line buffering for MSC 5.x and 6.0. + * MSC _IOLBF is the same as _IOFBF + */ +#if defined(MSDOS) && defined (_MSC_VER) +# undef _IOLBF +# define _IOLBF _IONBF +#endif + +/* in alloc.h: size_t is redefined + * defined in stdio.h which is included by alloc.h + */ +#if defined(MSDOS) && defined (_MSC_VER) +# define _TYPES_ +#endif + +/* in sysintf.c: SIGQUIT is used, this is not defined in MSC */ +#ifndef SIGQUIT +# define SIGQUIT SIGTERM +#endif + +/* MSC doesn't seem to care about CONST */ +#define CONST + +#ifndef MSDOS +# define MSDOS 1 +#endif + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +/* Have to pull this in for the standard lib defines */ +#include <io.h> diff --git a/dmake/msdos/microsft/config.mk b/dmake/msdos/microsft/config.mk new file mode 100644 index 000000000000..cd049cd471af --- /dev/null +++ b/dmake/msdos/microsft/config.mk @@ -0,0 +1,59 @@ +# This is the MSC 4.0 and higher DOS configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +TMPDIR := +.EXPORT : TMPDIR + +# Definition of macros for library, and C startup code. + +# The following sources are required for MSC +OSR_SRC = tempnam.c +.SETDIR=$(osrdir) : $(OSR_SRC) + +SRC += $(OSR_SRC) +.SOURCE.h : $(osrdir) + +SET_STACK = -stack:4096 +NDB_LDFLAGS += $(SET_STACK) + +ASFLAGS += -t -mx $(S_$(MODEL)) + +# Microsoft C doesn't need tail but needs head +LDTAIL = ; +LDHEAD = + +# Debugging libraries +DB_LDFLAGS += -co -li -map $(SET_STACK) +DB_LDLIBS += + +# NO Debug MSC flags: +# Set the environment variable MSC_VER to be one of 5.1, 6.0, 8.0 (for VC++4.0) +# to get these by default when you make dmake using 'dmake'. +# +# Setting MSC_VER to one of the above sets the variable _MSC_VER appropriately +# and sets the flags appropriately. + +CFLAGS += -I$(osrdir) $(C_$(MODEL)) -nologo +DB_CFLAGS += -Zi + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END + +C_s = +C_m = -AM +C_c = -AC +C_l = -AL + +S_s = -Dmsmall +S_m = -Dmmedium +S_c = -Dmcompact +S_l = -Dmlarge diff --git a/dmake/msdos/microsft/msc51/config.mk b/dmake/msdos/microsft/msc51/config.mk new file mode 100644 index 000000000000..beaae0dfea97 --- /dev/null +++ b/dmake/msdos/microsft/msc51/config.mk @@ -0,0 +1,11 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +.IMPORT .IGNORE : MSC_VER +MSC_VER *= 5.1 + +CFLAGS += -I$(osedir) -D_MSC_VER=$(MSC_VER:s,.,,)0 + +NDB_CFLAGS += -Oscl -Gs +NDB_LDFLAGS += -exe -packc -batch +NDB_LDLIBS += diff --git a/dmake/msdos/microsft/msc51/lib.rsp b/dmake/msdos/microsft/msc51/lib.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/microsft/msc51/lib.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/microsft/msc51/libswp.rsp b/dmake/msdos/microsft/msc51/libswp.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/microsft/msc51/libswp.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/microsft/msc51/mk.bat b/dmake/msdos/microsft/msc51/mk.bat new file mode 100755 index 000000000000..b111d6e62f01 --- /dev/null +++ b/dmake/msdos/microsft/msc51/mk.bat @@ -0,0 +1,102 @@ +md objects +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs infer.c +copy infer.obj objects +del infer.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs make.c +copy make.obj objects +del make.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs stat.c +copy stat.obj objects +del stat.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs expand.c +copy expand.obj objects +del expand.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmstring.c +copy dmstring.obj objects +del dmstring.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs hash.c +copy hash.obj objects +del hash.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dag.c +copy dag.obj objects +del dag.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmake.c +copy dmake.obj objects +del dmake.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs path.c +copy path.obj objects +del path.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs imacs.c +copy imacs.obj objects +del imacs.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs sysintf.c +copy sysintf.obj objects +del sysintf.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs parse.c +copy parse.obj objects +del parse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs getinp.c +copy getinp.obj objects +del getinp.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs quit.c +copy quit.obj objects +del quit.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs state.c +copy state.obj objects +del state.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmdump.c +copy dmdump.obj objects +del dmdump.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs macparse.c +copy macparse.obj objects +del macparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs rulparse.c +copy rulparse.obj objects +del rulparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs percent.c +copy percent.obj objects +del percent.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs function.c +copy function.obj objects +del function.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\runargv.c +copy runargv.obj objects +del runargv.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\arlib.c +copy arlib.obj objects +del arlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\switchar.c +copy switchar.obj objects +del switchar.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\tee.c +copy tee.obj objects +del tee.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\find.c +copy find.obj objects +del find.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs unix\dcache.c +copy dcache.obj objects +del dcache.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\microsft\tempnam.c +copy tempnam.obj objects +del tempnam.obj +link /stack:4096/exe/packc/batch @msdos\microsft\msc51\obj.rsp,dmake.exe,NUL.MAP; +copy msdos\microsft\msc51\template.mk startup\config.mk diff --git a/dmake/msdos/microsft/msc51/mkswp.bat b/dmake/msdos/microsft/msc51/mkswp.bat new file mode 100755 index 000000000000..5ab14d3517e5 --- /dev/null +++ b/dmake/msdos/microsft/msc51/mkswp.bat @@ -0,0 +1,104 @@ +md objects +masm -t -mx -Dmlarge msdos\exec.asm,,,; +mv exec.obj objects +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs infer.c +copy infer.obj objects +del infer.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs make.c +copy make.obj objects +del make.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs stat.c +copy stat.obj objects +del stat.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs expand.c +copy expand.obj objects +del expand.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmstring.c +copy dmstring.obj objects +del dmstring.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs hash.c +copy hash.obj objects +del hash.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dag.c +copy dag.obj objects +del dag.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmake.c +copy dmake.obj objects +del dmake.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs path.c +copy path.obj objects +del path.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs imacs.c +copy imacs.obj objects +del imacs.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs sysintf.c +copy sysintf.obj objects +del sysintf.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs parse.c +copy parse.obj objects +del parse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs getinp.c +copy getinp.obj objects +del getinp.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs quit.c +copy quit.obj objects +del quit.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs state.c +copy state.obj objects +del state.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs dmdump.c +copy dmdump.obj objects +del dmdump.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs macparse.c +copy macparse.obj objects +del macparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs rulparse.c +copy rulparse.obj objects +del rulparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs percent.c +copy percent.obj objects +del percent.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs function.c +copy function.obj objects +del function.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\runargv.c +copy runargv.obj objects +del runargv.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\arlib.c +copy arlib.obj objects +del arlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\switchar.c +copy switchar.obj objects +del switchar.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\spawn.c +copy spawn.obj objects +del spawn.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\find.c +copy find.obj objects +del find.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs unix\dcache.c +copy dcache.obj objects +del dcache.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc51 -D_MSC_VER=510 -Oscl -Gs msdos\microsft\tempnam.c +copy tempnam.obj objects +del tempnam.obj +link /stack:4096/exe/packc/batch @msdos\microsft\msc51\objswp.rsp,dmake.exe,NUL.MAP; +copy msdos\microsft\msc51\template.mk startup\config.mk diff --git a/dmake/msdos/microsft/msc51/obj.rsp b/dmake/msdos/microsft/msc51/obj.rsp new file mode 100644 index 000000000000..8f79a32754c9 --- /dev/null +++ b/dmake/msdos/microsft/msc51/obj.rsp @@ -0,0 +1,33 @@ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\tee.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj diff --git a/dmake/msdos/microsft/msc51/objswp.rsp b/dmake/msdos/microsft/msc51/objswp.rsp new file mode 100644 index 000000000000..54524124d236 --- /dev/null +++ b/dmake/msdos/microsft/msc51/objswp.rsp @@ -0,0 +1,34 @@ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj diff --git a/dmake/msdos/microsft/msc51/public.h b/dmake/msdos/microsft/msc51/public.h new file mode 100644 index 000000000000..c0c08e12cb82 --- /dev/null +++ b/dmake/msdos/microsft/msc51/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:44 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/microsft/msc51/template.mk b/dmake/msdos/microsft/msc51/template.mk new file mode 100644 index 000000000000..7174197d6284 --- /dev/null +++ b/dmake/msdos/microsft/msc51/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= microsft + OSENVIRONMENT *:= msc51 diff --git a/dmake/msdos/microsft/msc60/config.mk b/dmake/msdos/microsft/msc60/config.mk new file mode 100644 index 000000000000..5b206bec34bd --- /dev/null +++ b/dmake/msdos/microsft/msc60/config.mk @@ -0,0 +1,11 @@ +# Definition of macros for library, and C startup code. +osedir = $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT) + +.IMPORT .IGNORE : MSC_VER +MSC_VER *= 6.0 + +CFLAGS += -I$(osedir) -D_MSC_VER=$(MSC_VER:s,.,,)0 + +NDB_CFLAGS += -Osecgl -Gs +NDB_LDFLAGS += -exe -packc -batch +NDB_LDLIBS += diff --git a/dmake/msdos/microsft/msc60/lib.rsp b/dmake/msdos/microsft/msc60/lib.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/microsft/msc60/lib.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/microsft/msc60/libswp.rsp b/dmake/msdos/microsft/msc60/libswp.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/microsft/msc60/libswp.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/microsft/msc60/mk.bat b/dmake/msdos/microsft/msc60/mk.bat new file mode 100755 index 000000000000..c260b6d54abd --- /dev/null +++ b/dmake/msdos/microsft/msc60/mk.bat @@ -0,0 +1,102 @@ +md objects +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs infer.c +copy infer.obj objects +del infer.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs make.c +copy make.obj objects +del make.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs stat.c +copy stat.obj objects +del stat.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs expand.c +copy expand.obj objects +del expand.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmstring.c +copy dmstring.obj objects +del dmstring.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs hash.c +copy hash.obj objects +del hash.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dag.c +copy dag.obj objects +del dag.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmake.c +copy dmake.obj objects +del dmake.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs path.c +copy path.obj objects +del path.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs imacs.c +copy imacs.obj objects +del imacs.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs sysintf.c +copy sysintf.obj objects +del sysintf.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs parse.c +copy parse.obj objects +del parse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs getinp.c +copy getinp.obj objects +del getinp.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs quit.c +copy quit.obj objects +del quit.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs state.c +copy state.obj objects +del state.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmdump.c +copy dmdump.obj objects +del dmdump.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs macparse.c +copy macparse.obj objects +del macparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs rulparse.c +copy rulparse.obj objects +del rulparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs percent.c +copy percent.obj objects +del percent.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs function.c +copy function.obj objects +del function.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\runargv.c +copy runargv.obj objects +del runargv.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\arlib.c +copy arlib.obj objects +del arlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\switchar.c +copy switchar.obj objects +del switchar.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\tee.c +copy tee.obj objects +del tee.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\find.c +copy find.obj objects +del find.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs unix\dcache.c +copy dcache.obj objects +del dcache.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\microsft\tempnam.c +copy tempnam.obj objects +del tempnam.obj +link /stack:4096/exe/packc/batch @msdos\microsft\msc60\obj.rsp,dmake.exe,NUL.MAP; +copy msdos\microsft\msc60\template.mk startup\config.mk diff --git a/dmake/msdos/microsft/msc60/mkswp.bat b/dmake/msdos/microsft/msc60/mkswp.bat new file mode 100755 index 000000000000..6b9ed76a5085 --- /dev/null +++ b/dmake/msdos/microsft/msc60/mkswp.bat @@ -0,0 +1,104 @@ +md objects +masm -t -mx -Dmlarge msdos\exec.asm,,,; +mv exec.obj objects +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs infer.c +copy infer.obj objects +del infer.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs make.c +copy make.obj objects +del make.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs stat.c +copy stat.obj objects +del stat.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs expand.c +copy expand.obj objects +del expand.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmstring.c +copy dmstring.obj objects +del dmstring.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs hash.c +copy hash.obj objects +del hash.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dag.c +copy dag.obj objects +del dag.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmake.c +copy dmake.obj objects +del dmake.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs path.c +copy path.obj objects +del path.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs imacs.c +copy imacs.obj objects +del imacs.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs sysintf.c +copy sysintf.obj objects +del sysintf.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs parse.c +copy parse.obj objects +del parse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs getinp.c +copy getinp.obj objects +del getinp.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs quit.c +copy quit.obj objects +del quit.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs state.c +copy state.obj objects +del state.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs dmdump.c +copy dmdump.obj objects +del dmdump.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs macparse.c +copy macparse.obj objects +del macparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs rulparse.c +copy rulparse.obj objects +del rulparse.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs percent.c +copy percent.obj objects +del percent.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs function.c +copy function.obj objects +del function.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\ruletab.c +copy ruletab.obj objects +del ruletab.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirbrk.c +copy dirbrk.obj objects +del dirbrk.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\runargv.c +copy runargv.obj objects +del runargv.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\arlib.c +copy arlib.obj objects +del arlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dchdir.c +copy dchdir.obj objects +del dchdir.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\switchar.c +copy switchar.obj objects +del switchar.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\rmprq.c +copy rmprq.obj objects +del rmprq.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\spawn.c +copy spawn.obj objects +del spawn.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\find.c +copy find.obj objects +del find.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dirlib.c +copy dirlib.obj objects +del dirlib.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\dstrlwr.c +copy dstrlwr.obj objects +del dstrlwr.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs unix\dcache.c +copy dcache.obj objects +del dcache.obj +cl -c -I. -Imsdos -Imsdos\microsft -AL -nologo -Imsdos\microsft\msc60 -D_MSC_VER=600 -Osecgl -Gs msdos\microsft\tempnam.c +copy tempnam.obj objects +del tempnam.obj +link /stack:4096/exe/packc/batch @msdos\microsft\msc60\objswp.rsp,dmake.exe,NUL.MAP; +copy msdos\microsft\msc60\template.mk startup\config.mk diff --git a/dmake/msdos/microsft/msc60/obj.rsp b/dmake/msdos/microsft/msc60/obj.rsp new file mode 100644 index 000000000000..8f79a32754c9 --- /dev/null +++ b/dmake/msdos/microsft/msc60/obj.rsp @@ -0,0 +1,33 @@ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\tee.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj diff --git a/dmake/msdos/microsft/msc60/objswp.rsp b/dmake/msdos/microsft/msc60/objswp.rsp new file mode 100644 index 000000000000..54524124d236 --- /dev/null +++ b/dmake/msdos/microsft/msc60/objswp.rsp @@ -0,0 +1,34 @@ +objects\exec.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\spawn.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj diff --git a/dmake/msdos/microsft/msc60/public.h b/dmake/msdos/microsft/msc60/public.h new file mode 100644 index 000000000000..dbf2e595fe8e --- /dev/null +++ b/dmake/msdos/microsft/msc60/public.h @@ -0,0 +1,170 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:44:56 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +int spawnvpe ANSI((int, char *, char **, char **)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/microsft/msc60/template.mk b/dmake/msdos/microsft/msc60/template.mk new file mode 100644 index 000000000000..a147c694c5f7 --- /dev/null +++ b/dmake/msdos/microsft/msc60/template.mk @@ -0,0 +1,7 @@ +# ** Default build configuration for dmake. +# ** DO NOT PLACE LOCAL DEFINITIONS INTO THIS FILE IT IS AUTO GENERATED +# ** USE "startup/local.mk" for those. + + OS *:= msdos + OSRELEASE *:= microsft + OSENVIRONMENT *:= msc60 diff --git a/dmake/msdos/microsft/optoff.h b/dmake/msdos/microsft/optoff.h new file mode 100644 index 000000000000..b2426a1259ba --- /dev/null +++ b/dmake/msdos/microsft/optoff.h @@ -0,0 +1,27 @@ +/* RCS $Id: optoff.h,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $ +-- +-- SYNOPSIS +-- Turn off microsoft loop optimization. +-- +-- DESCRIPTION +-- This is broken in some pre 600 compilers so just turn it off. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#if _MSC_VER < 600 +# pragma loop_opt(off) +#endif diff --git a/dmake/msdos/microsft/tempnam.c b/dmake/msdos/microsft/tempnam.c new file mode 100644 index 000000000000..1a105c6b0f3a --- /dev/null +++ b/dmake/msdos/microsft/tempnam.c @@ -0,0 +1,110 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $ +-- +-- SYNOPSIS +-- tempnam +-- +-- DESCRIPTION +-- temp file name generation routines. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <dos.h> + +#if defined(max) +# undef max +#endif +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); +int d_access(); + +/* MSC stdio.h defines P_tmpdir, so let's undo it here */ +/* Under DOS leave the default tmpdir pointing here! */ +#ifdef P_tmpdir +#undef P_tmpdir +#endif +static char *P_tmpdir = ""; + +char * +tempnam(dir, prefix) +char *dir; /* use this directory please (if non-NULL) */ +char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + static int count = 0; + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + char buf[30]; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) ) + if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) ) + if( d_access( strcpy(p, P_tmpdir), 0) != 0 ) + if( !prefix ) + prefix = "tp"; + + if(prefix) + { + *(p+strlen(p)+2) = '\0'; + (void)strncat(p, prefix, 2); + } + + sprintf( buf, "%08x", _psp ); + buf[6]='\0'; + (void)strcat(p, buf ); + sprintf( buf, "%04d", count++ ); + q=p+strlen(p)-6; + *q++ = buf[0]; *q++ = buf[1]; + *q++ = buf[2]; *q++ = buf[3]; + + if( (q = strrchr(p,'.')) != NULL ) *q = '\0'; + + return(p); +} + + + +d_access( name, flag ) +char *name; +int flag; +{ + extern char *DirSepStr; + char *p; + int r; + + if( name == NULL || !*name ) return(1); /* NULL dir means current dir */ + r = access( name, flag ); + p = name+strlen(name)-1; + if(*p != '/' && *p != '\\') strcat( p, DirSepStr ); + + return( r ); +} diff --git a/dmake/msdos/rmprq.c b/dmake/msdos/rmprq.c new file mode 100644 index 000000000000..28fa1e392811 --- /dev/null +++ b/dmake/msdos/rmprq.c @@ -0,0 +1,44 @@ +/* RCS $Id: rmprq.c,v 1.2 2008-03-05 18:35:28 kz Exp $ +-- +-- SYNOPSIS +-- Remove prerequisites code. +-- +-- DESCRIPTION +-- This code is different for DOS and for UNIX and parallel make +-- architectures since the parallel case requires the rm's to be +-- run in parallel, whereas DOS guarantees to run them sequentially. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#if defined(USE_CREATEPROCESS) +/* MSVC6.0 and newer and MinGW use the parallel build enabled runargv(). */ +Force a compile-time blowup. +This file should not be used, use unix/rmprq.c instead. +#endif + +#include "extern.h" + +PUBLIC void +Remove_prq( tcp ) +CELLPTR tcp; +{ + tcp->ce_flag &= ~(F_MADE|F_VISITED); + tcp->ce_time = 0L; + + Make( tcp, tcp ); +} diff --git a/dmake/msdos/ruletab.c b/dmake/msdos/ruletab.c new file mode 100644 index 000000000000..524723415b32 --- /dev/null +++ b/dmake/msdos/ruletab.c @@ -0,0 +1,45 @@ +/* RCS $Id: ruletab.c,v 1.2 2006-04-20 12:06:11 hr Exp $ +-- +-- SYNOPSIS +-- Default initial configuration of dmake. +-- +-- DESCRIPTION +-- Define here the initial set of rules that are defined before +-- dmake performs any processing. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* These are control macros for dmake that MUST be defined at some point + * if they are NOT dmake will not work! These are default definitions. They + * may be overridden inside the .STARTUP makefile, they are here + * strictly so that dmake can parse the STARTUP makefile */ + +#include <stdio.h> + +static char *_rules[] = { + "MAXLINELENGTH := 2046", + "MAXPROCESSLIMIT := 1", + "MAXPROCESS := 1", + ".IMPORT .IGNORE: DMAKEROOT", + ".MAKEFILES : makefile.mk makefile", + ".SOURCE : .NULL", +#include "startup.h" + (char *)NULL }; + +char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */ + diff --git a/dmake/msdos/runargv.c b/dmake/msdos/runargv.c new file mode 100644 index 000000000000..373b075c3fc5 --- /dev/null +++ b/dmake/msdos/runargv.c @@ -0,0 +1,188 @@ +/* RCS $Id: runargv.c,v 1.6 2008-03-05 18:35:53 kz Exp $ +-- +-- SYNOPSIS +-- Run a sub process. +-- +-- DESCRIPTION +-- Use spawn to run a subprocess. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#if defined(USE_CREATEPROCESS) +/* MSVC6.0 and newer and MinGW use the parallel build enabled runargv(). */ +Force a compile-time blowup. +This file should not be used, use unix/runargv.c instead. +#endif + +#include <process.h> +#include <errno.h> +#include "extern.h" +#include "sysintf.h" + +static int _abort_flg = FALSE; +static void _add_child ANSI((CELLPTR, int)); +static void _finished_child ANSI((int)); + +PUBLIC int +runargv(target, group, last, cmnd_attr, cmd) +CELLPTR target; +int group; +int last; +t_attr cmnd_attr; /* Attributes for current cmnd. */ +char **cmd; /* Simulate a reference to *cmd. */ +{ + int ignore = (cmnd_attr & A_IGNORE)!= 0; /* Ignore errors ('-'). */ + int shell = (cmnd_attr & A_SHELL) != 0; /* Use shell ('+'). */ + int mute = (cmnd_attr & A_MUTE) != 0; /* Mute output ('@@'). */ +#if ! defined(_MSC_VER) +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x500 + extern char ** _RTLENTRY _EXPDATA environ; +#else + extern char **environ; +#endif +#endif + int status; + char **argv; + int old_stdout = -1; /* For redirecting shell escapes */ + int old_stderr = -1; /* and silencing @@-recipes */ + char *tcmd = *cmd; /* For saver/easier string arithmetic on *cmd. */ + + if( Measure & M_RECIPE ) + Do_profile_output( "s", M_RECIPE, target ); + + _add_child(target, ignore); + + /* redirect output for _exec_shell / @@-recipes. */ + if( Is_exec_shell ) { + /* Add error checking? */ + old_stdout = dup(1); + dup2( fileno(stdout_redir), 1 ); + } + if( mute ) { + old_stderr = dup(2); + dup2( zerofd, 2 ); + + if( !Is_exec_shell ) { + old_stdout = dup(1); + dup2( zerofd, 1 ); + } + } + + /* Return immediately for empty line or noop command. */ + if ( !*tcmd || /* empty line */ + ( strncmp(tcmd, "noop", 4) == 0 && /* noop command */ + (iswhite(tcmd[4]) || tcmd[4] == '\0')) ) { + status = 0; + } + else if( !shell && /* internal echo only if not in shell */ + strncmp(tcmd, "echo", 4) == 0 && + (iswhite(tcmd[4]) || tcmd[4] == '\0') ) { + int nl = 1; + + tcmd = tcmd + 4; + + while( iswhite(*tcmd) ) ++tcmd; + if ( strncmp(tcmd,"-n",2 ) == 0) { + nl = 0; + tcmd = tcmd+2; + while( iswhite(*tcmd) ) ++tcmd; + } + printf("%s%s", tcmd, nl ? "\n" : ""); + fflush(stdout); + status = 0; + } + else { + argv = Pack_argv( group, shell, cmd ); + Packed_shell = shell||group; + + /* The last two arguments would need (const char *const *) casts + * to silence the warning when building with MinGW. */ + status = spawnvpe(P_WAIT, *argv, argv, environ); + } + + /* Restore stdout/stderr if needed. */ + if( old_stdout != -1 ) { + dup2(old_stdout, 1); + if( old_stderr != -1 ) + dup2(old_stderr, 2); + } + + if( status == -1 ) { + /* spawnvpe failed */ + fprintf(stderr, "%s: Error executing '%s': %s", + Pname, argv[0], strerror(errno) ); + if( ignore||Continue ) { + fprintf(stderr, " (Ignored)" ); + } + fprintf(stderr, "\n"); + } + + if( Measure & M_RECIPE ) + Do_profile_output( "e", M_RECIPE, target ); + + _finished_child(status); + if( last && !Doing_bang ) Update_time_stamp( target ); + + return( 0 ); +} + + +PUBLIC void +Clean_up_processes() +{ + _abort_flg = TRUE; + _finished_child(-1); +} + + +PUBLIC int +Wait_for_child( abort_flg, pid ) +int abort_flg; +int pid; +{ + /* There is currently no parallel processing for this OS, always + * return -1 indicating that there was nothing to wait for. */ + return(-1); +} + + +static int _valid = -1; +static CELLPTR _tg; +static int _ignore; + +static void +_add_child( target, ignore ) +CELLPTR target; +int ignore; +{ + _tg = target; + _ignore = ignore; + _valid = 0; + + Current_target = NIL(CELL); +} + + +static void +_finished_child(status) +int status; +{ + if( _valid == -1 ) return; + _valid = -1; + Handle_result( status, _ignore, _abort_flg, _tg ); +} diff --git a/dmake/msdos/spawn.c b/dmake/msdos/spawn.c new file mode 100644 index 000000000000..bc6bb4c64783 --- /dev/null +++ b/dmake/msdos/spawn.c @@ -0,0 +1,415 @@ +/* RCS $Id: spawn.c,v 1.3 2007-10-15 15:43:28 ihi Exp $ +-- +-- SYNOPSIS +-- Spawnvpe code to emulate spawnvpe call common to DOS compilers. +-- +-- DESCRIPTION +-- This implementation is further integrated into dmake in that it +-- determines the program to execute and if it's extension is either +-- .bat or .ksh it executes it using the appropriate shell based on the +-- setting of .MKSARGS. If .MKSARGS is set then in addition +-- to the command tail getting built the arguments are also passed in the +-- environment pursuant to the published MKS argument passing conventions. +-- If the variable Swap_on_exec is set and the DOS OS supports it +-- then the dmake executable image is swapped to secondary storage prior +-- to running the child process. This is requested by setting the +-- appropriate flag in the call to exec. +-- +-- This and the exec.asm routine are derived from work that was supplied +-- to me by Kent Williams (williams@umaxc.weeg.uiowa.edu) and by +-- Len Reed, (..!gatech!holos0!lbr or holos0!lbr@gatech.edu., Holos +-- Software, Inc., Tucker, Ga.). I sincerely acknowledge their help since +-- their Turbo C, and MSC 6.0 code lead directly to this combined +-- swapping exec that hopefully works with either compiler in all memory +-- models. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include <stdio.h> +#include <stdlib.h> + +#if defined(_MSC_VER) && _MSC_VER >= 600 + /* Ignore the MSC 6.0 library's "const"-riddled prototype + for spawnvpe. + */ +# define spawnvpe _ignore_msc_spawnvpe +# include <process.h> +# undef spawnvpe + int spawnvpe(int, char *, char **, char **); +#else +# include <process.h> +#endif + +#include <dos.h> +#include <errno.h> +#include <string.h> +#include <alloc.h> +#include <fcntl.h> +#include "extern.h" +#include "dosdta.h" +#include "exec.h" +#include "sysintf.h" + +extern int Interrupted; + +/* variables and functions local to this file */ +static char *_findexec ANSI((char *, int *)); +static char **_getpath ANSI(()); +static char far *_dos_alloc ANSI((uint16)); + +static uint16 _swap_mask; +static int _mks_args; +static char dot_com[] = ".COM", + dot_exe[] = ".EXE", + dot_bat[] = ".BAT", + dot_ksh[] = ".KSH"; + +/* Kinds of executables */ +#define SCR 1 +#define COM 2 +#define EXE 4 +#define ALL (SCR|COM|EXE) + +/* How to make a long pointer */ +#define CF(x) (char far *)x + +/* Make sure we know how to get a segment out of a long pointer */ +#ifndef FP_SEG +#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16)) +#endif + +iz81252 changed the parameters for Pack_argv() but this file did not get fixed! +PUBLIC int +spawnvpe(mode, program, av, ep)/* +================================= + Spawn a process using an environment and a vector of arguments. + The code computes a new environment, puts the MKS arguments into + it if need be, and calls the appropriate routines to search the + path and to invoke the process. */ +int mode; +char *program; +char **av; +char **ep; +{ + char pwd[PATH_MAX+1]; + char **envp = ep; /* Cause we are going to mess with it. */ + char **argv = av; /* Same with this one. */ + char cmdtail[129]; + char far *environment; + char *tail; + char *swptmp; + unsigned int envsize; + unsigned int cmdsize; + int cmdtailen; + int i; + int doswap; + + /* First check to see if we can find the program to execute this way we + * don't alloc the environment and other such stuff prior to figuring out + * we don't know how to run the program. */ +find_program: + if((program = _findexec(program, &i)) == NIL(char)) { + errno = ENOENT; + return( -1 ); + } + + /* i is set to TRUE in _findexec if the exec is a shell + * script (either .BAT or .KSH file), returns FALSE for all others. */ + if( i && !Packed_shell ) { + /* Restore the spaces into the command line that were erased by + * the previous call to Pack_argv. This enables us to repack the + * command as a shell command using Pack_argv again. */ + for( i=0; argv[i] != NIL(char); i++ ) { + int x = strlen(argv[i]); + if( argv[i+1] != NIL(char) ) argv[i][x] = ' '; + } + + argv = Pack_argv( FALSE, TRUE, *argv ); + Packed_shell = TRUE; /* Previous call implies shell = TRUE. */ + + /* Go and find the program again, I hate goto's but it seems silly to + * use tail recursion here just for aesthetic purity. */ + program = *argv; + goto find_program; + } + + /* Compute size of *argv vector for passing as MKS style arguments */ + cmdsize = strlen(*argv)+2; + + /* So we have decided on a program to run, therefore pack the command tail + * and build the environment to pass to the exec code. This loop packs the + * DOS command tail, and computes the size of all arguments for the MKS + * argument passing convention. Note that we reserve one less byte in the + * command tail if we are not using MKS style argument passing. + * + * Make sure the command tail contains at leat a space. Some commands fail + * to work if the command tail is only a \r, STUPID DOS! */ + cmdtailen = ((_mks_args = ((Glob_attr & A_MKSARGS) != 0)) != 0)?3:2; + tail = cmdtail+1; + + if( argv[1] != NIL(char) ) + for( i=1; argv[i] != NIL(char); i++ ) { + int arglen = strlen(argv[i]); + + cmdsize += arglen+2; /* Compute all args size for MKS */ + + if( (cmdtailen += arglen+1) <= 128 ) { + register char *p = argv[i]; + tail[-1] = ' '; /* put in the space */ + while( *tail++ = *p++ ); /* put in the arg */ + } + else if( !_mks_args ) { + errno = E2BIG; /* unless its MKS exit if arglist */ + return(-1); /* is too long. */ + } + } + else + *tail++ = ' '; + + /* Finish the command tail set up, placing the length in the first byte, + * and the \r \n \0 at the end for DOS, MKS and us respectively. */ + *cmdtail = tail-cmdtail-2; + tail[-1] = '\r'; + if( _mks_args ) *tail++ = '\n'; + *tail = '\0'; + + /* Compute size of environment, skipping any MKS arguments passed in our + * environment */ + for(; *envp && **envp == '~'; envp++ ); + for(i=0, envsize=_mks_args?cmdsize:1; envp[i] != NIL(char); i++ ) + envsize += strlen(envp[i]) + 1; + + /* Check the DOS version number here. If it is < 3.0 then we don't + * even want to think about executing the swapping code. Permanently + * set swap to 0. */ + doswap = (_osmajor < 3) ? 0 : Swap_on_exec; + + /* Set up temporary file for swapping */ + swptmp = doswap?tempnam(NIL(char),"mk"):""; + + /* Allocate an appropriate sized environment block and align it on a + * paragraph boundary. It will later get copied to an appropriately low + * place in the executable image so that when we swap out the environment + * is still present. Use + * _dos_alloc + * to allocate the environment segment. The segment is freed by the call + * to exec. */ + environment = _dos_alloc( envsize = ((envsize+16)>>4) ); + *environment = '\0'; + + /* First copy the arguments preceeded by ~ character if we are using + * MKS style argument passing */ + if( _mks_args ) + for(; *argv; argv++) { + register char *p = *argv; + + *environment++ = '~'; + while( *environment++ = *p++ ); /* Far dest, poss near ptr */ + } + + /* Now stick in the current evironment vectors. */ + for(; *envp; envp++) { + register char *p = *envp; + while( *environment++ = *p++ ); /* Far dest, poss near ptr */ + } + + /* Clear the interrupted flag, and exec */ + Interrupted = 0; + + /* Preserve the current working directory accross a spawn call + * DOS is brain dead about this. This way we have some hope of cleaning + * up the swapping tempfiles after we return. */ + strcpy(pwd,Get_current_dir()); + i = exec(doswap,CF(program),CF(cmdtail),FP_SEG(environment),CF(swptmp)); + Set_dir(pwd); + + /* Now free the temporary file name */ + if( doswap ) FREE(swptmp); + + /* If swap was interrupted then quit properly from dmake. */ + if( Interrupted ) Quit(); + + return(i); +} + + +PUBLIC void +Hook_std_writes( file ) +char *file; +{ + if( file!= NIL(char) ) { + int mode = O_BINARY | O_WRONLY | O_CREAT | O_TRUNC; + int handle; + + if (*file == '+') { + ++file; /* -F +file means append to file */ + mode = O_BINARY | O_WRONLY | O_CREAT | O_APPEND; + } + handle = open(file, mode, S_IREAD | S_IWRITE); + if (handle < 0) { + Fatal( "Could not open -F file"); + } + (void) lseek(handle, 0L, SEEK_END); + do_hook_std_writes(handle); + } + else + do_unhook_std_writes(); +} + + +/* +** _findexec finds executables on the path. +** Note that it is pretty simple to add support for other executable types +** shell scripts, etc. +** +** This follows the command.com behavior very closely. +*/ +static char * +_findexec( s, is_shell )/* +========================== + Cloned closely from code provided by Kent Williams. Stripped his down to + a reduced search since dmake doesn't need to recompute the PATH vector + each time it does the search since it cannot alter the path vector once + it begins to make recipes. Also modified it to use findfirst and findnext + as provided for dirlib package that I got off the net. */ +char *s; +int *is_shell; +{ + unsigned found_flags; + char **pathv = NIL(char *); + char *ext = NIL(char); + char *buf = NIL(char); + char *p[2]; + char *dot_scr; + char *dot; + + p[0] = ""; p[1] = NIL(char); + if( strchr("./\\", *s) || s[1] == ':' ) + pathv = p; + else if( (pathv = _getpath()) == NIL(char *) ) + return( NIL(char) ); + + /* Compute the extension we need if any. */ + if( (dot = strrchr(s,'.')) != NIL(char) && + dot > strrchr(s,'/') && dot > strrchr(s,'\\') ) + ext = dot+1; + + dot_scr = _mks_args ? dot_ksh : dot_bat; + *is_shell = FALSE; + + for( found_flags = 0; *pathv && !found_flags; pathv++ ) { + DTA dta; + + if( !ext ) { + char *name; + buf = Build_path( *pathv, name=DmStrJoin(s, ".???", -1, FALSE) ); + FREE(name); + } + else + buf = Build_path( *pathv, s ); + + if( findfirst((char *)strupr(buf), &dta) != NIL(DTA) ) { + if( !ext ) { + char *dot; + + /* search order is .com .exe (.ksh || .bat) + * there has to be a '.' */ + do { + dot = strrchr(dta.name,'.'); + if(0 == strcmp(dot,dot_com)) + found_flags |= COM; + else if(0 == strcmp(dot,dot_exe)) + found_flags |= EXE; + else if( 0 == strcmp(dot,dot_scr) ) + found_flags |= SCR; + } while( found_flags != ALL && findnext(&dta) != NIL(DTA) ); + + if(found_flags & COM) ext = dot_com; + else if(found_flags & EXE) ext = dot_exe; + else if(found_flags & SCR) { + ext = dot_scr; + *is_shell = TRUE; + } + + if( found_flags ) { + char *name; + buf = Build_path( *pathv, name=DmStrJoin(s,ext,-1,FALSE) ); + FREE(name); + strupr(buf); + } + } + else + found_flags++; + } + } + + return( found_flags ? buf : NIL(char) ); +} + + +/* +** getpath turns the DOS path into a char *vector, It is gotten and +** transformed only once since dmake can't modify the value of PATH while +** it is making targets. +*/ +static char ** +_getpath() +{ + static char **dir = NIL(char *); + register char *p; + + if( !dir ) { + register char *t; + int i; + char *semi = NIL(char); + + if( (p = getenv("PATH")) == NIL(char) ) p = ""; + for( i=1, t=p; *t; t++ ) if( *t == ';' ) i++; + + TALLOC(dir, i+1, char *); + p = DmStrDup(p); + + for( i=0; p; p = semi ? (semi+1):NIL(char),i++ ){ + if( (semi = strchr(p,';')) != NIL(char) ) *semi = '\0'; + dir[i] = p; + } + dir[i]=NIL(char); + } + + return( dir ); +} + + +static char far * +_dos_alloc( size )/* +==================== + This routine allocates size paragraphs from DOS. It changes the memory + allocation strategy to allocate from the tail and then changes it back. + to using first fit. */ +uint16 size; +{ + union REGS r; + + r.h.ah = 0x48; + r.x.bx = size; + + intdos( &r, &r ); + if( r.x.cflag ) No_ram(); + + return( (char far *) MK_FP(r.x.ax, 0) ); +} diff --git a/dmake/msdos/startup.h b/dmake/msdos/startup.h new file mode 100644 index 000000000000..660285c4b19b --- /dev/null +++ b/dmake/msdos/startup.h @@ -0,0 +1,26 @@ +/* RCS $Id: startup.h,v 1.2 2006-04-20 12:06:36 hr Exp $ +-- +-- SYNOPSIS +-- Dmake startup header file definition. +-- +-- DESCRIPTION +-- Where we define the default value of MAKESTARTUP. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +"MAKESTARTUP := $(DMAKEROOT)\\startup.mk", diff --git a/dmake/msdos/switchar.c b/dmake/msdos/switchar.c new file mode 100644 index 000000000000..8879a9ad7c44 --- /dev/null +++ b/dmake/msdos/switchar.c @@ -0,0 +1,55 @@ +/* RCS $Id: switchar.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- switch char query. +-- +-- DESCRIPTION +-- Get the current value of the command line switch char. Only useful +-- in a DOS environment, otherwise we #define it to be '-'. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#if defined(_MSC_VER) +#include <stdlib.h> +#endif +#include <dos.h> +#include <stdio.h> +#include "stdmacs.h" + +getswitchar()/* +=============== + Try the environment first. If you don't find SWITCHAR there, then use + the DOS call. The call is undocumented, and doesn't work for DOS versions + 4.0 and up, so the check of the environment will fix that. */ +{ +#if defined(__MSDOS__) || defined(M_I86) + union REGS rg; + static char *_env_switchar = NIL(char); + + if( _env_switchar != NIL(char) || + (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) ) + return(*_env_switchar); + + rg.h.ah = 0x37; /* switch char request */ + rg.h.al = 0; /* get (not set) */ + + intdos(&rg, &rg); + return (rg.h.dl); +#endif /* M_I86 */ + + return ('-'); +} diff --git a/dmake/msdos/sysintf.h b/dmake/msdos/sysintf.h new file mode 100644 index 000000000000..9b7b45cdaab4 --- /dev/null +++ b/dmake/msdos/sysintf.h @@ -0,0 +1,52 @@ +/* RCS $Id: sysintf.h,v 1.2 2007-01-18 09:34:40 vg Exp $ +-- +-- SYNOPSIS +-- Interfaces for sysintf.c +-- +-- DESCRIPTION +-- Abstractions of functions in sysintf.c +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +#define DMSTAT stat +#define VOID_LCACHE(l,m) +#define GETPID _psp + +extern char * tempnam(); +extern char * getcwd(); + +/* +** standard C items +*/ + +/* +** DOS interface standard items +*/ +#define chdir(p) dchdir(p) + +/* +** make parameters +*/ +#ifdef _POSIX_NAME_MAX +#undef _POSIX_NAME_MAX +#endif +#define _POSIX_NAME_MAX 12 + +#ifdef _POSIX_PATH_MAX +#undef _POSIX_PATH_MAX +#endif +#define _POSIX_PATH_MAX 64 diff --git a/dmake/msdos/tee.c b/dmake/msdos/tee.c new file mode 100644 index 000000000000..f2c8b5de6543 --- /dev/null +++ b/dmake/msdos/tee.c @@ -0,0 +1,31 @@ +/* RCS $Id: tee.c,v 1.1.1.1 2000-09-22 15:33:27 hr Exp $ +-- +-- SYNOPSIS +-- Hook_std_writes() dummy call for non swapping MSDOS versions. +-- +-- DESCRIPTION +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#include "extern.h" + +PUBLIC void +Hook_std_writes( file ) +char *file; +{ +} diff --git a/dmake/msdos/zortech/config.h b/dmake/msdos/zortech/config.h new file mode 100644 index 000000000000..dabc8b014fe6 --- /dev/null +++ b/dmake/msdos/zortech/config.h @@ -0,0 +1,52 @@ +/* RCS $Id: config.h,v 1.2 2008-03-05 18:37:45 kz Exp $ +-- +-- SYNOPSIS +-- Configurarion include file. +-- +-- DESCRIPTION +-- There is one of these for each specific machine configuration. +-- It can be used to further tweek the machine specific sources +-- so that they compile. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +/* in sysintf.c: SIGQUIT is used, this is not defined in ZTC */ +#ifndef SIGQUIT +# define SIGQUIT SIGTERM +#endif + +/* in sysintf.c: tzset is not supported by ZTC */ +#define tzset() + +/* ZTC uses it's own swapping spawn. */ +#define spawnvpe(a,b,c,d) spawnvp(a,b,c) + +#ifndef CONST +# define CONST const +#endif + +#ifndef MSDOS +# define MSDOS 1 +#endif + +extern unsigned _psp; + +/* a small problem with pointer to voids on some unix machines needs this */ +#define DMPVOID void * + +#include <io.h> diff --git a/dmake/msdos/zortech/config.mk b/dmake/msdos/zortech/config.mk new file mode 100644 index 000000000000..e947dc87620b --- /dev/null +++ b/dmake/msdos/zortech/config.mk @@ -0,0 +1,73 @@ +# This is the ZTC DOS configuration file for DMAKE +# It simply modifies the values of SRC, and checks to see if +# OSENVIRONMENT is defined. If so it includes the appropriate +# config.mk file. +# +# It also sets the values of .SOURCE.c and .SOURCE.h to include the local +# directory. +# +osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE) + +TMPDIR := +.EXPORT : TMPDIR + +# Definition of macros for library, and C startup code. +# Swapping for DOS versions is enabled by default. ZTC will automatically +# perform swapping to XMS, EMS or disk by including _swapl.obj at link time. +# To be most effective, _swapl.obj should be the first file linked so we +# assign it to CSTARTUP if needed. +.IF $(SWAP) == y + CSTARTUP = _swapl.obj +.END + +# The following sources are required for ZTC +# The tempnam supplied with ZTC doesn't handle a NULL dir. +OSR_SRC = tempnam.c environ.c +.SETDIR=$(osrdir) : $(OSR_SRC) + +SRC += $(OSR_SRC) +.SOURCE.h : $(osrdir) + +# Local configuration modifications for CFLAGS +# If you have a 286, you can use -2 or appropriate to get better code, +# in that case uncomment the line below. (You can also simply set +# it in the CL environment variable.) +#CFLAGS += -2 +ASFLAGS += -t -mx $(S_$(MODEL)) + +# Redefine this, it isn't needed! +LDTAIL = ; + +# Debugging libraries +DB_LDFLAGS += -g +DB_LDLIBS += + +# NO Debug ZTC flags: +# + +CFLAGS += -I$(osrdir) $(C_$(MODEL)) +CFLAGS += -DM_I86=1 -DMSDOS +CFLAGS += -b # use large compiler +#CFLAGS += -w # no warnings +CFLAGS += -mi # integer only +CFLAGS += -p # no auto-prototyping +NDB_CFLAGS += -o +DB_CFLAGS += -g + +# Redefine rule for making our objects, we don't need mv +%$O : %.c ;% $(CC) -c $(CFLAGS) -o$@ $< + +# See if we modify anything in the lower levels. +.IF $(OSENVIRONMENT) != $(NULL) + .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk +.END + +C_s = +C_m = -mM +C_c = -mC +C_l = -mL + +S_s = -Dmsmall +S_m = -Dmmedium +S_c = -Dmcompact +S_l = -Dmlarge diff --git a/dmake/msdos/zortech/environ.c b/dmake/msdos/zortech/environ.c new file mode 100644 index 000000000000..c76d9a4831a6 --- /dev/null +++ b/dmake/msdos/zortech/environ.c @@ -0,0 +1,59 @@ +/* RCS $Id: environ.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $ +-- +-- SYNOPSIS +-- environment routines. +-- +-- DESCRIPTION +-- Someone thought that Zortech needs this. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include "alloc.h" + +/* ZTC++ doesn't have environ, so we have to create one. */ + +extern char *_envptr; +char **environ = { NULL }; + +void +make_env() +{ + int i; + char *cp; + + for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1) + ; + + TALLOC(environ, i+1, char*); + + for (i = 0, cp = _envptr; *cp; i++, cp += strlen(cp)+1) + environ[i] = cp; + + return; +} + +void +free_env() +{ + FREE(environ); + + return; +} diff --git a/dmake/msdos/zortech/lib.rsp b/dmake/msdos/zortech/lib.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/zortech/lib.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/zortech/libswp.rsp b/dmake/msdos/zortech/libswp.rsp new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/dmake/msdos/zortech/libswp.rsp @@ -0,0 +1 @@ + diff --git a/dmake/msdos/zortech/mkswp.bat b/dmake/msdos/zortech/mkswp.bat new file mode 100755 index 000000000000..60c12d37217e --- /dev/null +++ b/dmake/msdos/zortech/mkswp.bat @@ -0,0 +1,36 @@ +md objects +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\infer.obj infer.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\make.obj make.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\stat.obj stat.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\expand.obj expand.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmstring.obj dmstring.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\hash.obj hash.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dag.obj dag.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmake.obj dmake.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\path.obj path.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\imacs.obj imacs.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\sysintf.obj sysintf.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\parse.obj parse.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\getinp.obj getinp.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\quit.obj quit.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\state.obj state.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dmdump.obj dmdump.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\macparse.obj macparse.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rulparse.obj rulparse.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\percent.obj percent.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\function.obj function.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\ruletab.obj msdos\ruletab.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirbrk.obj msdos\dirbrk.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\runargv.obj msdos\runargv.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\arlib.obj msdos\arlib.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dchdir.obj msdos\dchdir.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\switchar.obj msdos\switchar.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\rmprq.obj msdos\rmprq.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tee.obj msdos\tee.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\find.obj msdos\find.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dirlib.obj msdos\dirlib.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dstrlwr.obj msdos\dstrlwr.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\dcache.obj unix\dcache.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\tempnam.obj msdos\zortech\tempnam.c +ztc -c -I. -Imsdos -Imsdos\zortech -mL -DM_I86=1 -DMSDOS -b -mi -p -o -oobjects\environ.obj msdos\zortech\environ.c +blink @msdos\zortech\objswp.rsp,dmake.exe,NUL.MAP; diff --git a/dmake/msdos/zortech/obj.rsp b/dmake/msdos/zortech/obj.rsp new file mode 100644 index 000000000000..c97a42f9f0aa --- /dev/null +++ b/dmake/msdos/zortech/obj.rsp @@ -0,0 +1,34 @@ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\tee.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\environ.obj diff --git a/dmake/msdos/zortech/objswp.rsp b/dmake/msdos/zortech/objswp.rsp new file mode 100644 index 000000000000..60a33c4eb523 --- /dev/null +++ b/dmake/msdos/zortech/objswp.rsp @@ -0,0 +1,35 @@ +_swapl.obj+ +objects\infer.obj+ +objects\make.obj+ +objects\stat.obj+ +objects\expand.obj+ +objects\dmstring.obj+ +objects\hash.obj+ +objects\dag.obj+ +objects\dmake.obj+ +objects\path.obj+ +objects\imacs.obj+ +objects\sysintf.obj+ +objects\parse.obj+ +objects\getinp.obj+ +objects\quit.obj+ +objects\state.obj+ +objects\dmdump.obj+ +objects\macparse.obj+ +objects\rulparse.obj+ +objects\percent.obj+ +objects\function.obj+ +objects\ruletab.obj+ +objects\dirbrk.obj+ +objects\runargv.obj+ +objects\arlib.obj+ +objects\dchdir.obj+ +objects\switchar.obj+ +objects\rmprq.obj+ +objects\tee.obj+ +objects\find.obj+ +objects\dirlib.obj+ +objects\dstrlwr.obj+ +objects\dcache.obj+ +objects\tempnam.obj+ +objects\environ.obj diff --git a/dmake/msdos/zortech/public.h b/dmake/msdos/zortech/public.h new file mode 100644 index 000000000000..6265caa0ce3b --- /dev/null +++ b/dmake/msdos/zortech/public.h @@ -0,0 +1,169 @@ +/* RCS $Id: public.h,v 1.9 2007-10-15 15:45:09 ihi Exp $ +-- WARNING -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT +-- +-- +-- SYNOPSIS +-- Local functions exported to be visible by others. +-- +-- DESCRIPTION +-- This file is generated by 'genpub'. Function declarations +-- that appear in this file are extracted by 'genpub' from +-- source files. Any function in the source file whose definition +-- appears like: +-- +-- PUBLIC return_type +-- function( arg_list ); +-- type_expr1 arg1; +-- ... +-- +-- has its definition extracted and a line of the form: +-- +-- return_type function ANSI((type_expr1,type_expr2,...)); +-- +-- entered into the output file. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ + +#ifndef _DMAKE_PUBLIC_h +#define _DMAKE_PUBLIC_h + +#ifdef EXTERN +#undef EXTERN +#endif +#if defined(DEFINE_DMAKE_VARIABLES) +#define EXTERN +#else +#define EXTERN extern +#endif + +/***** genpub: Begin list of generated function headers */ +void Infer_recipe ANSI((CELLPTR, CELLPTR)); +int Make_targets ANSI(()); +int Make ANSI((CELLPTR, CELLPTR)); +int Exec_commands ANSI((CELLPTR)); +void Print_cmnd ANSI((char *, int, int)); +int Push_dir ANSI((char *, char *, int)); +void Pop_dir ANSI((int)); +void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Stat_target ANSI((CELLPTR, int, int)); +char *Expand ANSI((char *)); +char *Apply_edit ANSI((char *, char *, char *, int, int)); +void Map_esc ANSI((char *)); +char* Apply_modifiers ANSI((int, char *)); +char* Tokenize ANSI((char *, char *, char, int)); +char* ScanToken ANSI((char *, char **, int)); +char *DmStrJoin ANSI((char *, char *, int, int)); +char *DmStrAdd ANSI((char *, char *, int)); +char *DmStrApp ANSI((char *, char *)); +char *DmStrDup ANSI((char *)); +char *DmStrDup2 ANSI((char *)); +char *DmStrPbrk ANSI((char *, char *)); +char *DmStrSpn ANSI((char *, char *)); +char *DmStrStr ANSI((char *, char *)); +char *DmSubStr ANSI((char *, char *)); +uint16 Hash ANSI((char *, uint32 *)); +HASHPTR Get_name ANSI((char *, HASHPTR *, int)); +HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *)); +HASHPTR Push_macro ANSI((HASHPTR)); +HASHPTR Pop_macro ANSI((HASHPTR)); +HASHPTR Def_macro ANSI((char *, char *, int)); +CELLPTR Def_cell ANSI((char *)); +LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int)); +void Clear_prerequisites ANSI((CELLPTR)); +int Test_circle ANSI((CELLPTR, int)); +STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int)); +t_attr Rcp_attribute ANSI((char *)); +int main ANSI((int, char **)); +FILE *Openfile ANSI((char *, int, int)); +FILE *Closefile ANSI(()); +FILE *Search_file ANSI((char *, char **)); +char *Filename ANSI(()); +int Nestlevel ANSI(()); +FILE *TryFiles ANSI((LINKPTR)); +void Fatal ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Error ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void Warning ANSI((ARG (char *,fmt),ARG (va_alist_type, va_alist))); +void No_ram ANSI(()); +void Usage ANSI((int)); +void Version ANSI(()); +char *Get_suffix ANSI((char *)); +char *Basename ANSI((char *)); +char *Filedir ANSI((char *)); +char *Build_path ANSI((char *, char *)); +void Make_rules ANSI(()); +void Create_macro_vars ANSI(()); +time_t Do_stat ANSI((char *, char *, char **, int)); +int Do_touch ANSI((char *, char *, char **)); +void Void_lib_cache ANSI((char *, char *)); +time_t Do_time ANSI(()); +void Do_profile_output ANSI((char *, uint16, CELLPTR)); +int Do_cmnd ANSI((char **, int, int, CELLPTR, t_attr, int)); +char ** Pack_argv ANSI((int, int, char **)); +char *Read_env_string ANSI((char *)); +int Write_env_string ANSI((char *, char *)); +void ReadEnvironment ANSI(()); +void Catch_signals ANSI((void (*)(int))); +void Clear_signals ANSI(()); +void Prolog ANSI((int, char* [])); +void Epilog ANSI((int)); +char *Get_current_dir ANSI(()); +int Set_dir ANSI((char*)); +char Get_switch_char ANSI(()); +FILE* Get_temp ANSI((char **, char *)); +FILE *Start_temp ANSI((char *, CELLPTR, char **)); +void Open_temp_error ANSI((char *, char *)); +void Link_temp ANSI((CELLPTR, FILE *, char *)); +void Close_temp ANSI((CELLPTR, FILE *)); +void Unlink_temp_files ANSI((CELLPTR)); +void Handle_result ANSI((int, int, int, CELLPTR)); +void Update_time_stamp ANSI((CELLPTR)); +int Remove_file ANSI((char *)); +void Parse ANSI((FILE *)); +int Get_line ANSI((char *, FILE *)); +char *Do_comment ANSI((char *, char **, int)); +char *Get_token ANSI((TKSTRPTR, char *, int)); +void Quit ANSI((int)); +void Read_state ANSI(()); +void Write_state ANSI(()); +int Check_state ANSI((CELLPTR, STRINGPTR *, int)); +void Dump ANSI(()); +void Dump_recipe ANSI((STRINGPTR)); +int Parse_macro ANSI((char *, int)); +int Macro_op ANSI((char *)); +int Parse_rule_def ANSI((int *)); +int Rule_op ANSI((char *)); +void Add_recipe_to_list ANSI((char *, int, int)); +void Bind_rules_to_targets ANSI((int)); +int Set_group_attributes ANSI((char *)); +DFALINKPTR Match_dfa ANSI((char *)); +void Check_circle_dfa ANSI(()); +void Add_nfa ANSI((char *)); +char *Exec_function ANSI((char *)); +int If_root_path ANSI((char *)); +int runargv ANSI((CELLPTR, int, int, t_attr, char **)); +void Clean_up_processes ANSI(()); +int Wait_for_child ANSI((int, int)); +time_t seek_arch ANSI((char*, char*)); +int touch_arch ANSI((char*, char*)); +int dchdir ANSI((char *)); +void Remove_prq ANSI((CELLPTR)); +void Hook_std_writes ANSI((char *)); +void dstrlwr ANSI((char *, char *)); +time_t CacheStat ANSI((char *, int)); + +#endif diff --git a/dmake/msdos/zortech/startup.mk b/dmake/msdos/zortech/startup.mk new file mode 100644 index 000000000000..2697f738bb5b --- /dev/null +++ b/dmake/msdos/zortech/startup.mk @@ -0,0 +1,153 @@ +# MSDOS DMAKE startup file. Customize to suit your needs. +# Assumes MKS toolkit for the tool commands, and Zortech C. Change as req'd. +# See the documentation for a description of internally defined macros. +# +# Disable warnings for macros redefined here that were given +# on the command line. +__.SILENT !:= $(.SILENT) +.SILENT !:= yes + +# Configuration parameters for DMAKE startup.mk file +# Set these to NON-NULL if you wish to turn the parameter on. +_HAVE_RCS := yes # yes => RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC ROOTDIR +TMPDIR *:= $(ROOTDIR)/tmp + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\\ + DIVFILE = $(TMPFILE:s,/,\,) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}},) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := ztc # C-compiler and flags + CFLAGS += + + AS := masm # Assembler and flags + ASFLAGS += + + LD = blink # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) -S $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := any_pc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O : %.c ; $(CC) $(CFLAGS) -c $< + %$O : %.cpp ; $(CC) $(CFLAGS) -c $< + %$O : %$P ; $(PC) $(PFLAGS) -c $< + %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O :| %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS) + +# lex and yacc rules + %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A .SWAP .GROUP : + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +"@B" = $(@:b) +"@D" = $(@:d) +"@F" = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) +"<B" = $(<:b) +"<D" = $(<:d) +"<F" = $(<:f) +"?B" = $(?:b) +"?F" = $(?:f) +"?D" = $(?:d) + +# Turn warnings back to previous setting. +.SILENT !:= $(__.SILENT) + +# Local init file if any, gets parsed before user makefile +.INCLUDE .IGNORE: "_startup.mk" diff --git a/dmake/msdos/zortech/tempnam.c b/dmake/msdos/zortech/tempnam.c new file mode 100644 index 000000000000..91ce19c490ad --- /dev/null +++ b/dmake/msdos/zortech/tempnam.c @@ -0,0 +1,106 @@ +/* RCS $Id: tempnam.c,v 1.1.1.1 2000-09-22 15:33:29 hr Exp $ +-- +-- SYNOPSIS +-- temname +-- +-- DESCRIPTION +-- temp file name generation code. +-- +-- AUTHOR +-- Dennis Vadura, dvadura@dmake.wticorp.com +-- +-- WWW +-- http://dmake.wticorp.com/ +-- +-- COPYRIGHT +-- Copyright (c) 1996,1997 by WTI Corp. All rights reserved. +-- +-- This program is NOT free software; you can redistribute it and/or +-- modify it under the terms of the Software License Agreement Provided +-- in the file <distribution-root>/readme/license.txt. +-- +-- LOG +-- Use cvs log to obtain detailed change logs. +*/ +/*LINTLIBRARY*/ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <dos.h> + +#if defined(max) +# undef max +#endif +#define max(A,B) (((A)<(B))?(B):(A)) + +extern char *mktemp(); +extern int access(); +int d_access(); + +/* Zortech C stdio.h doesn't define P_tmpdir, so let's do it here */ +/* Under DOS leave the default tmpdir pointing here! */ +static char *P_tmpdir = ""; + +char * +tempnam(dir, prefix) +const char *dir; /* use this directory please (if non-NULL) */ +const char *prefix; /* use this (if non-NULL) as filename prefix */ +{ + static int count = 0; + register char *p, *q, *tmpdir; + int tl=0, dl=0, pl; + char buf[30]; + + pl = strlen(P_tmpdir); + + if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir); + else if( (tmpdir = getenv("TMP")) != NULL ) tl = strlen(tmpdir); + if( dir != NULL ) dl = strlen(dir); + + if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL ) + return(NULL); + + *p = '\0'; + + if( (tl == 0) || (d_access( strcpy(p, tmpdir), 0) != 0) ) + if( (dl == 0) || (d_access( strcpy(p, dir), 0) != 0) ) + if( d_access( strcpy(p, P_tmpdir), 0) != 0 ) + if( !prefix ) + prefix = "tp"; + + if(prefix) + { + *(p+strlen(p)+2) = '\0'; + (void)strncat(p, prefix, 2); + } + + sprintf( buf, "%08x", _psp ); + buf[6]='\0'; + (void)strcat(p, buf ); + sprintf( buf, "%04d", count++ ); + q=p+strlen(p)-6; + *q++ = buf[0]; *q++ = buf[1]; + *q++ = buf[2]; *q++ = buf[3]; + + if( (q = strrchr(p,'.')) != NULL ) *q = '\0'; + + return(p); +} + + + +d_access( name, flag ) +char *name; +int flag; +{ + extern char *DirSepStr; + char *p; + int r; + + if( name == NULL || !*name ) return(1); /* NULL dir means current dir */ + r = access( name, flag ); + p = name+strlen(name)-1; + if(*p != '/' && *p != '\\') strcat( p, DirSepStr ); + + return( r ); +} |