diff --git a/configure.ac b/configure.ac index b3a854b..d7e87d0 100755 --- a/configure.ac +++ b/configure.ac @@ -76,7 +76,7 @@ case "$_os" in OS_VERSION=cygwin CASE_INSENSITIVE_FS=true ;; - "MINGW") + MINGW*) OS_VERSION=mingw OS_TYPE=winnt BUILDINFO="Windows / MinGW" @@ -85,7 +85,7 @@ case "$_os" in "MSVC6") OS_VERSION=msvc6 OS_TYPE=winnt - BUILDINFO="Windows / MS Visual C++" + BUILDINFO="Windows / MS Visual C++" dmstr2\(_MSC_FULL_VER\) CASE_INSENSITIVE_FS=true ;; "Darwin") diff --git a/dag.c b/dag.c index 0dab95e..688161c 100644 --- a/dag.c +++ b/dag.c @@ -643,16 +643,16 @@ int no_check; DB_PRINT( "rul", ("Defining recipe %s", rcp) ); if( !white_too ) rcp = DmStrSpn( rcp, " \t" ); - if( (rcp == NIL(char)) || (*rcp == 0 && !white_too) ) + if( *rcp == 0 && !white_too ) DB_RETURN( sp ); /* return last recipe when new recipe not added */ rp = no_check ? rcp : DmStrSpn( rcp, " \t@-+%" ); TALLOC(nsp, 1, STRING); nsp->st_string = DmStrDup( rp ); + /*nsp->st_next = NIL(STRING); already null*/ if( sp != NIL(STRING) ) sp->st_next = nsp; - nsp->st_next = NIL(STRING); if( !no_check ) nsp->st_attr |= Rcp_attribute( rcp ); diff --git a/dmake.h b/dmake.h index 8d70a1b..25782fa 100644 --- a/dmake.h +++ b/dmake.h @@ -228,5 +228,10 @@ #define STOBOOL(A) (A && ((*A | 0x20) == 'y')) #define BTOBOOL(A) (A) +/* To stringify the result of the expansion of a macro argument + * use two levels of macros. */ +#define dmstr2(s) dmstr1(s) +#define dmstr1(s) #s + #endif diff --git a/dmstring.c b/dmstring.c index 077f0cf..fced305 100644 --- a/dmstring.c +++ b/dmstring.c @@ -138,11 +138,12 @@ DmStrDup( str )/* char *str; { char *t; + size_t len; if( str == NIL(char) ) return( NIL(char) ); - - if( (t = MALLOC( strlen( str )+1, char )) == NIL(char) ) No_ram(); - strcpy( t, str ); + len = strlen( str )+1; + if( (t = MALLOC( len, char )) == NIL(char) ) No_ram(); + t = memcpy( t, str, len ); return( t ); } @@ -211,10 +212,7 @@ char *searchchars; if( s1 == NIL(char) || searchchars == NIL(char) ) return( "" ); - t = strpbrk(s1, searchchars); - if( !t ) - t = s1+strlen(s1); - return( t ); + return( s1+strcspn(s1, searchchars) ); } @@ -234,8 +232,7 @@ char *s2; if( s1 == NIL(char) || s2 == NIL(char) ) return( "" ); - for( t=s1; *t && (strchr( s2, *t ) != NIL(char)); t++ ); - return( t ); + return( s1 + strspn(s1, s2) ); } diff --git a/extern.h b/extern.h index ff0f6af..abe3e23 100644 --- a/extern.h +++ b/extern.h @@ -30,6 +30,23 @@ /* For MSVC++ needs to include windows.h first to avoid problems with * type redefinitions. Include it also for MinGW for consistency. */ #if defined(__MINGW32__) || defined(_MSC_VER) +/* silence warnings about using null term strings in >= VC 2005 +sysintf.c(918) : warning C4996: 'strcat' was declared deprecated + Message: 'This function or variable may be unsafe. Consider using strcat +_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online hel +p for details.' */ +#define _CRT_SECURE_NO_DEPRECATE +/* silence warnings about using POSIX name funcs in >= VC 2005 +sysintf.c(1132) : warning C4996: 'unlink' was declared deprecated + C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\stdio.h(290) : see + declaration of 'unlink' + Message: 'The POSIX name for this item is deprecated. Instead, use the I +SO C++ conformant name: _unlink. See online help for details.' */ +#define _CRT_NONSTDC_NO_DEPRECATE +/* get back some of the perf loss caused by >= VC 2005 dropping single threaded + static link CRT, this macro disables multithreading locks on some stdio + functions */ +#define _CRT_DISABLE_PERFCRIT_LOCKS #define WIN32_LEAN_AND_MEAN #include #endif @@ -169,7 +186,7 @@ char *cygdospath(char *src, int winpath); #endif #ifdef _WIN32 -# define FileTimeTo_time_t(ft) ((time_t)((*((unsigned __int64 *)ft) - 116444736000000000ULL)/10000000ULL)) +# define FileTimeTo_time_t(ft) ((time_t)((*((unsigned __int64 *)ft) - 116444736000000000)/10000000)) #endif /* Get the working directory fall back code */ diff --git a/function.c b/function.c index e4022f4..da49832 100644 --- a/function.c +++ b/function.c @@ -392,8 +392,14 @@ char *data; data = Expand(data); - Append_line( data, TRUE, tmpfile, name, FALSE, FALSE ); - Close_temp( Current_target, tmpfile ); + /* Expand's decendents can change Current_target, example + "$(mktmp $(HEADER) $(shell @type text_file_on_disk) $(FOOTER))" will do it. + Is that a bug? Should Current_target be saved to a C auto? IDK. See also a + comment by the original author in Exec_commands(). "type" is a + Win32 command. ~bulk88 + */ + Append_line( data, TRUE, tmpfile, FALSE, FALSE ); + Close_temp( Current_target, tmpfile, name ); FREE(data); return( text ); diff --git a/imacs.c b/imacs.c index 1b0e3a5..e8d9dd7 100644 --- a/imacs.c +++ b/imacs.c @@ -28,9 +28,7 @@ #include "extern.h" -#define DM_StGiFy(a) #a -#define STRINGIFY(a) DM_StGiFy(a) -#define SET_INT_VAR_FROM_INT(name, val, flag, var) _set_int_var_from_int_and_str(name, val, STRINGIFY(val), flag, var) +#define SET_INT_VAR_FROM_INT(name, val, flag, var) _set_int_var_from_int_and_str(name, val, dmstr2(val), flag, var) static void _set_int_var ANSI((char *, char *, int, int *)); static void _set_int_var_from_int_and_str ANSI((char *, int, char *, int, int *)); diff --git a/mac/public.h b/mac/public.h index dd7b657..798973e 100644 --- a/mac/public.h +++ b/mac/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/macparse.c b/macparse.c index f9595dd..5b2e370 100644 --- a/macparse.c +++ b/macparse.c @@ -151,9 +151,9 @@ int flag; cp = lp->cl_prq; } TALLOC(sp,1,STRING); - sp->st_string = DmStrDup(tok2); sp->st_next = cp->ce_cond; cp->ce_cond = sp; + sp->st_string = DmStrDup(tok2); tok1 = NIL(char); } diff --git a/make.bat b/make.bat index 1bcc125..ba6c082 100755 --- a/make.bat +++ b/make.bat @@ -41,10 +41,12 @@ echo msc60 - Microsoft C 6.0 compile. echo msc60swp - Microsoft C 6.0, MASM 5.1 compile of swapping dmake. echo win95-bcc50 - Borland C++ 5.0 32-bit compile of dmake. -echo win95-vpp40 - Microsoft VC++ 4.0 32-bit compile of dmake. -echo win95-vpp70 - MS VC++ ^>= 2003 optimized -echo win95-vpp70 rel - MS VC++ ^>= 2003 optimized -echo win95-vpp70 dbg - MS VC++ ^>= 2003 unoptimized for debugging +echo win95-vpp40 - Microsoft VC++ 4.0-6.0 optimized +echo win95-vpp40 rel - Microsoft VC++ 4.0-6.0 optimized +echo win95-vpp40 dbg - Microsoft VC++ 4.0-6.0 unoptimized for debugging +echo win95-vpp70 - MS VC++ ^>= 2003 32 or 64 bit optimized +echo win95-vpp70 rel - MS VC++ ^>= 2003 32 or 64 bit optimized +echo win95-vpp70 dbg - MS VC++ ^>= 2003 32 or 64 bit unoptimized 4 debugging goto end rem This is the script that makes dmake using Microsoft C 5.1 diff --git a/make.c b/make.c index 0dff356..af2142c 100644 --- a/make.c +++ b/make.c @@ -54,7 +54,7 @@ typedef struct { static void _drop_mac ANSI((HASHPTR)); static void _set_recipe ANSI((char*, int)); static void _set_tmd ANSI(()); -static void _append_file ANSI((STRINGPTR, FILE*, char*, int)); +static void _append_file ANSI((STRINGPTR, FILE*, int)); static LINKPTR _dup_prq ANSI((LINKPTR)); static LINKPTR _expand_dynamic_prq ANSI(( LINKPTR, LINKPTR, char * )); static char* _prefix ANSI((char *, char *)); @@ -1316,7 +1316,7 @@ CELLPTR cp; /* Emit group prolog */ if( attr & A_PROLOG ) - _append_file( _recipes[RP_GPPROLOG], tmpfile, cp->CE_NAME, trace ); + _append_file( _recipes[RP_GPPROLOG], tmpfile, trace ); } if( !useshell ) @@ -1420,7 +1420,7 @@ CELLPTR cp; if( group ) /* Append_line() calls Print_cmnd(). */ - Append_line( cmnd, TRUE, tmpfile, cp->CE_NAME, trace, 0 ); + Append_line( cmnd, TRUE, tmpfile, trace, 0 ); else { /* Don't print empty recipe lines. .ROOT and .TARGETS * deliberately might have empty "" recipes and we don't want @@ -1440,14 +1440,14 @@ CELLPTR cp; * execute the command */ if( group && !(cp->ce_attr & A_ERROR) ) { if( attr & A_EPILOG ) /* emit epilog */ - _append_file( _recipes[RP_GPEPILOG], tmpfile, cp->CE_NAME, trace ); + _append_file( _recipes[RP_GPEPILOG], tmpfile, trace ); if( trace ) fputs("]\n", stdout); do_it = !Trace; if( do_it ) { - Close_temp( cp, tmpfile ); + Close_temp( cp, tmpfile, cp->CE_NAME ); #if defined(UNIX) chmod(groupfile,0700); @@ -1656,11 +1656,10 @@ int ind; PUBLIC void -Append_line( cmnd, newline, tmpfile, name, printit, map ) +Append_line( cmnd, newline, tmpfile, printit, map ) char *cmnd; int newline; FILE *tmpfile; -char *name; int printit; int map; { @@ -1670,25 +1669,20 @@ int map; fputs(cmnd, tmpfile); if( newline ) fputc('\n', tmpfile); - fflush(tmpfile); - - if( ferror(tmpfile) ) - Fatal("Write error on temporary file, while processing `%s'", name); } static void -_append_file( rp, tmpfile, name, printit ) +_append_file( rp, tmpfile, printit ) register STRINGPTR rp; FILE *tmpfile; -char *name; int printit; { char *cmnd; while( rp != NIL(STRING) ) { - Append_line(cmnd = Expand(rp->st_string), TRUE, tmpfile, name, printit,0); + Append_line(cmnd = Expand(rp->st_string), TRUE, tmpfile, printit,0); FREE(cmnd); rp = rp->st_next; } diff --git a/msdos/borland/bcc30/public.h b/msdos/borland/bcc30/public.h index 8b50fb5..ab68a5d 100644 --- a/msdos/borland/bcc30/public.h +++ b/msdos/borland/bcc30/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/borland/bcc40/public.h b/msdos/borland/bcc40/public.h index 7ee9ec8..61bf85d 100644 --- a/msdos/borland/bcc40/public.h +++ b/msdos/borland/bcc40/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/borland/bcc45/public.h b/msdos/borland/bcc45/public.h index 0df1c77..ddc878b 100644 --- a/msdos/borland/bcc45/public.h +++ b/msdos/borland/bcc45/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/borland/bcc50/public.h b/msdos/borland/bcc50/public.h index 04aca67..3b9ba49 100644 --- a/msdos/borland/bcc50/public.h +++ b/msdos/borland/bcc50/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/borland/tcc20/public.h b/msdos/borland/tcc20/public.h index 6325d85..d1bd020 100644 --- a/msdos/borland/tcc20/public.h +++ b/msdos/borland/tcc20/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/microsft/msc51/public.h b/msdos/microsft/msc51/public.h index 9cfc3ee..7504a97 100644 --- a/msdos/microsft/msc51/public.h +++ b/msdos/microsft/msc51/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/microsft/msc60/public.h b/msdos/microsft/msc60/public.h index a396fe6..f170308 100644 --- a/msdos/microsft/msc60/public.h +++ b/msdos/microsft/msc60/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/msdos/zortech/public.h b/msdos/zortech/public.h index 85486c4..60e3d99 100644 --- a/msdos/zortech/public.h +++ b/msdos/zortech/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/os2/ibm/icc/public.h b/os2/ibm/icc/public.h index a2dbda2..1253c40 100644 --- a/os2/ibm/icc/public.h +++ b/os2/ibm/icc/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/os2/ibm/icc3/public.h b/os2/ibm/icc3/public.h index 94a3c11..c5b0e2f 100644 --- a/os2/ibm/icc3/public.h +++ b/os2/ibm/icc3/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/qssl/public.h b/qssl/public.h index 01b1861..9f57b19 100644 --- a/qssl/public.h +++ b/qssl/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/readme/read1st.txt b/readme/read1st.txt index 34b5424..3295c71 100644 --- a/readme/read1st.txt +++ b/readme/read1st.txt @@ -29,13 +29,18 @@ Building Dmake With autotools -------------- Building dmake on systems that are supported by the autotools build system -only requires the usual "./configure && make && make install" command. -The configure command will notify you when your platform is not supported. +only requires the usual "./autogen.sh && ./configure && make && make install" +command. The configure command will notify you when your platform is not +supported. With Microsoft C++ compiler --------------------------- -For MS Visual C++ 6 and up run "make.bat win95-vpp40" in a command shell. -This should create a dmake.exe in the top-level directory. +For MS Visual C++ 4 through 6 run "make.bat win95-vpp40" in a command shell. +For MS Visual C++ 2003 and up run "make.bat win95-vpp70" in a command shell. +Both 32 bit and 64 bit builds are supported. The bitness of the dmake build is +determined by the bitness of cl.exe which was found in PATH. Use "vcvars32" or +"vcvarsall x64" to pick the correct Visual C++ compiler. A dmake.exe will be +created in the top-level directory. It is possible to rename this to, say, dmake0.exe, delete the objects/ sub-directory and then simply run "dmake0.exe" to build a new dmake.exe. diff --git a/rulparse.c b/rulparse.c index 7ac1239..9b14aba 100644 --- a/rulparse.c +++ b/rulparse.c @@ -413,7 +413,7 @@ int no_check; { DB_ENTER( "Add_recipe_to_list" ); - if( rule != NIL( char ) && (*rule != '\0' || white_too) ) { + if( *rule != '\0' || white_too ) { DB_PRINT( "par", ("Adding recipe [%s]", rule) ); _sv_crule = Def_recipe( rule, _sv_crule, white_too, no_check ); diff --git a/sysintf.c b/sysintf.c index ea9b632..5a74f08 100644 --- a/sysintf.c +++ b/sysintf.c @@ -840,18 +840,25 @@ char *fname; ** Close a previously used temporary file. */ PUBLIC void -Close_temp(cp, file) +Close_temp(cp, file, name) CELLPTR cp; FILE *file; +char *name; { FILELISTPTR fl; + int status; if( cp == NIL(CELL) ) cp = Root; for( fl=cp->ce_files; fl && fl->fl_file != file; fl=fl->fl_next ); if( fl ) { fl->fl_file = NIL(FILE); - fclose(file); + status = fclose(file); + } else { /* if it isn't supposed to be closed, atleast it has to be flushed */ + status = fflush(file); } + if( status == EOF ) + Fatal("Close or Write error on temporary file, while processing `%s'", name); + return; } @@ -1129,7 +1136,12 @@ char *name; if( (buf.st_mode & S_IFMT) == S_IFDIR ) return 1; #endif +#ifdef _WIN32 +/* we dont need errno set, no callers check errno */ + return !DeleteFile(name); +#else return(unlink(name)); +#endif } diff --git a/tos/public.h b/tos/public.h index e869b30..d7a4218 100644 --- a/tos/public.h +++ b/tos/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/386ix/public.h b/unix/386ix/public.h index 18ab3f4..f2b0f5d 100644 --- a/unix/386ix/public.h +++ b/unix/386ix/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/bsd43/public.h b/unix/bsd43/public.h index ce667ee..32a2ed3 100644 --- a/unix/bsd43/public.h +++ b/unix/bsd43/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/bsd43/uw/public.h b/unix/bsd43/uw/public.h index 4a69d31..8547509 100644 --- a/unix/bsd43/uw/public.h +++ b/unix/bsd43/uw/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/bsd43/vf/public.h b/unix/bsd43/vf/public.h index 5507dde..b94b9d2 100644 --- a/unix/bsd43/vf/public.h +++ b/unix/bsd43/vf/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/bsdarm32/public.h b/unix/bsdarm32/public.h index 3f43cee..2520a38 100644 --- a/unix/bsdarm32/public.h +++ b/unix/bsdarm32/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/coherent/ver40/public.h b/unix/coherent/ver40/public.h index 313f413..e91d63d 100644 --- a/unix/coherent/ver40/public.h +++ b/unix/coherent/ver40/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/coherent/ver42/public.h b/unix/coherent/ver42/public.h index ac2889d..ba9312e 100644 --- a/unix/coherent/ver42/public.h +++ b/unix/coherent/ver42/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/cygwin/public.h b/unix/cygwin/public.h index ac96a0e..32556bd 100644 --- a/unix/cygwin/public.h +++ b/unix/cygwin/public.h @@ -60,7 +60,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -129,7 +129,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/dcache.c b/unix/dcache.c index c538567..10989b4 100644 --- a/unix/dcache.c +++ b/unix/dcache.c @@ -35,11 +35,11 @@ #undef __WIN32__ #endif +#include "extern.h" #ifdef __APPLE__ #include #endif #include -#include "extern.h" #include @@ -156,8 +156,15 @@ int force; * the same directory. This would only happen if different targets * using different upper/lower case spellings for the same directory * and is *never* a good idea. */ +#ifndef _WIN32 if (Set_dir(udir) == 0) { if((dirp=opendir(".")) != NIL(DIR)) { +#else +/* stat (or any other IO call) isn't called below on Win32 + so no need to change cwd */ + if (1) { + if((dirp=opendir(udir)) != NIL(DIR)) { +#endif while((direntp=readdir(dirp)) != NULL) { TALLOC(ep,1,Entry); ep->name = DmStrDup(direntp->d_name); /* basename only */ @@ -181,7 +188,9 @@ int force; } closedir(dirp); } +#ifndef _WIN32 Set_dir(Pwd); +#endif } } diff --git a/unix/linux/gnu/public.h b/unix/linux/gnu/public.h index ac96a0e..32556bd 100644 --- a/unix/linux/gnu/public.h +++ b/unix/linux/gnu/public.h @@ -60,7 +60,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -129,7 +129,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/macosx/gnu/public.h b/unix/macosx/gnu/public.h index 41a7f13..fa7e4fb 100644 --- a/unix/macosx/gnu/public.h +++ b/unix/macosx/gnu/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/os2/public.h b/unix/os2/public.h index ac96a0e..32556bd 100644 --- a/unix/os2/public.h +++ b/unix/os2/public.h @@ -60,7 +60,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -129,7 +129,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/runargv.c b/unix/runargv.c index b181ae1..c83dbc1 100644 --- a/unix/runargv.c +++ b/unix/runargv.c @@ -106,8 +106,6 @@ _finished_child(pid, status) [unix/runargv] handles the finished child. If with runargv(). */ -#include - #include "extern.h" #ifdef HAVE_WAIT_H diff --git a/unix/solaris/gnu/public.h b/unix/solaris/gnu/public.h index d14adc3..355c9a5 100644 --- a/unix/solaris/gnu/public.h +++ b/unix/solaris/gnu/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/solaris/public.h b/unix/solaris/public.h index 2ed32a9..0931288 100644 --- a/unix/solaris/public.h +++ b/unix/solaris/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -127,7 +127,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/sysvr1/public.h b/unix/sysvr1/public.h index 83d62e6..b88437c 100644 --- a/unix/sysvr1/public.h +++ b/unix/sysvr1/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/sysvr3/gnu/public.h b/unix/sysvr3/gnu/public.h index 7516976..5bfc13a 100644 --- a/unix/sysvr3/gnu/public.h +++ b/unix/sysvr3/gnu/public.h @@ -57,7 +57,7 @@ int Make_targets ANSI(()); int Exec_commands ANSI((CELLPTR)); void Print_cmnd ANSI((char *, int, int)); void Pop_dir ANSI((int)); -void Append_line ANSI((char *, int, FILE *, char *, int, int)); +void Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -126,7 +126,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/sysvr3/public.h b/unix/sysvr3/public.h index 857ade8..ecf4b8b 100644 --- a/unix/sysvr3/public.h +++ b/unix/sysvr3/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/sysvr3/pwd/public.h b/unix/sysvr3/pwd/public.h index c4ce082..7b7d78e 100644 --- a/unix/sysvr3/pwd/public.h +++ b/unix/sysvr3/pwd/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/sysvr4/public.h b/unix/sysvr4/public.h index fa6f36c..5efa9d1 100644 --- a/unix/sysvr4/public.h +++ b/unix/sysvr4/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/xenix/public.h b/unix/xenix/public.h index 8378340..bca620b 100644 --- a/unix/xenix/public.h +++ b/unix/xenix/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/unix/xenix/pwd/public.h b/unix/xenix/pwd/public.h index 34c43d4..15ba736 100644 --- a/unix/xenix/pwd/public.h +++ b/unix/xenix/pwd/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/win95/borland/bcc50/public.h b/win95/borland/bcc50/public.h index 86ccf42..a5a0357 100644 --- a/win95/borland/bcc50/public.h +++ b/win95/borland/bcc50/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/win95/microsft/config.h b/win95/microsft/config.h index 2b67f1c..48cfd67 100644 --- a/win95/microsft/config.h +++ b/win95/microsft/config.h @@ -34,11 +34,6 @@ Don't forget to update the PACKAGE and VERSION macros! */ -/* Name and version number of this package */ -#define PACKAGE "dmake" -#define VERSION "4.13" -#define BUILDINFO "Windows / MS Visual C++" - #if defined (_MSC_VER) # if _MSC_VER < 500 Force a compile-time blowup. @@ -83,34 +78,105 @@ # define CONST #endif +/* Build info string */ +#define BUILDINFO "Windows / MS Visual C++ " dmstr2(_MSC_FULL_VER) + /* Assume case insensitive file system. */ #define CASE_INSENSITIVE_FS 1 -/* MSC has sys/types.h and sys/stat.h (this is tested only with MSVC++ 6.0) */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 /* These functions are available! (this is tested only with MSVC++ 6.0) */ -#define HAVE_GETCWD 1 #define HAVE_UTIME_NULL 1 -#define HAVE_TZSET 1 -#define HAVE_STRLWR 1 +/* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 -#define HAVE_STRERROR 1 -#define HAVE_TEMPNAM 1 + +/* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `setvbuf' function. */ #define HAVE_SETVBUF 1 /* These defines are needed for itypes.h! (this is tested only with MSVC++ 6.0) */ +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlwr' function. */ +#define HAVE_STRLWR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tempnam' function. */ +#define HAVE_TEMPNAM 1 + +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Name of package */ +#define PACKAGE "dmake" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "dmake" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "dmake 4.13" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "dmake" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.13" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 + +/* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + #ifndef MSDOS # define MSDOS 1 #endif +/* Version number of package */ +#define VERSION "4.13" + /* a small problem with pointer to voids on some unix machines needs this */ #define DMPVOID void * diff --git a/win95/microsft/ruletab.c b/win95/microsft/ruletab.c index aa35282..fdfe36d 100644 --- a/win95/microsft/ruletab.c +++ b/win95/microsft/ruletab.c @@ -35,11 +35,6 @@ #define MAXIMUM_WAIT_OBJECTS 1 #endif -/* To stringify the result of the expansion of a macro argument - * use two levels of macros. */ -#define dmstr2(s) dmstr1(s) -#define dmstr1(s) #s - static char *_rules[] = { "MAXLINELENGTH := 32766", "MAXPROCESSLIMIT := " dmstr2(MAXIMUM_WAIT_OBJECTS) , diff --git a/win95/microsft/sysintf.h b/win95/microsft/sysintf.h index f12cc25..0299732 100644 --- a/win95/microsft/sysintf.h +++ b/win95/microsft/sysintf.h @@ -61,3 +61,7 @@ extern char * getcwd(); #undef _POSIX_PATH_MAX #endif #define _POSIX_PATH_MAX _MAX_PATH + +#if _MSC_VER >= 1400 +# define fputc(_c,_stream) _fputc_nolock(_c,_stream) +#endif diff --git a/win95/microsft/vpp40/mk.bat b/win95/microsft/vpp40/mk.bat index c00777c..3cec0a3 100755 --- a/win95/microsft/vpp40/mk.bat +++ b/win95/microsft/vpp40/mk.bat @@ -1,42 +1,60 @@ -if not "%1" == "" goto link +if not defined cc set "cc=cl" +if not defined ld set "ld=link" + +if "%1" == "" goto optimized +if "%1" == "rel" goto optimized + +set "c_opt=-Od -Gy -GF" +set "ld_opt=" +goto build + +:optimized +set "c_opt=-O2" +set "ld_opt=" + +:build if exist objects rd /S /Q objects if exist config.h del config.h if exist dmake.exe del dmake.exe +if exist dmake.pdb del dmake.pdb md objects -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\infer.obj infer.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\make.obj make.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\stat.obj stat.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\expand.obj expand.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmstring.obj dmstring.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\hash.obj hash.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dag.obj dag.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dcache.obj unix\dcache.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmake.obj dmake.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\path.obj path.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\imacs.obj imacs.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\sysintf.obj sysintf.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\parse.obj parse.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\getinp.obj getinp.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\quit.obj quit.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\state.obj state.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dmdump.obj dmdump.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\macparse.obj macparse.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rulparse.obj rulparse.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\percent.obj percent.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\function.obj function.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\switchar.obj win95\switchar.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dstrlwr.obj msdos\dstrlwr.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\arlib.obj msdos\arlib.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\dirbrk.obj msdos\dirbrk.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\infer.obj infer.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\make.obj make.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\stat.obj stat.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\expand.obj expand.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dmstring.obj dmstring.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\hash.obj hash.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dag.obj dag.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dcache.obj unix\dcache.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dmake.obj dmake.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\path.obj path.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\imacs.obj imacs.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\sysintf.obj sysintf.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\parse.obj parse.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\getinp.obj getinp.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\quit.obj quit.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\state.obj state.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dmdump.obj dmdump.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\macparse.obj macparse.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\rulparse.obj rulparse.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\percent.obj percent.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\function.obj function.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\switchar.obj win95\switchar.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dstrlwr.obj msdos\dstrlwr.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\arlib.obj msdos\arlib.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dirbrk.obj msdos\dirbrk.c rem Not needed for MSVC 6 and up. Lesser versions not supported -rem cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\tempnam.obj tempnam.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\ruletab.obj win95\microsft\ruletab.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\runargv.obj unix\runargv.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\rmprq.obj unix\rmprq.c -cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge -Foobjects\allochnd.obj win95\microsft\allochnd.cpp +rem %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\tempnam.obj tempnam.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\ruletab.obj win95\microsft\ruletab.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\runargv.obj unix\runargv.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\rmprq.obj unix\rmprq.c +%cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\allochnd.obj win95\microsft\allochnd.cpp :link rem link /nologo /out:dmake.exe @fix95nt\win95\microsft\vpp40\obj.rsp -if "%c_flg%" == "" link /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp -if not "%c_flg%" == "" link /DEBUG:notmapped,full /DEBUGTYPE:cv /PDB:NONE /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp +%ld% /out:dmake.exe -debug -opt:icf,ref %ld_opt% @.\win95\microsft\vpp40\obj.rsp copy win95\microsft\vpp40\template.mk startup\config.mk + +rem clean up our env vars so they dont leak to cmd shell +set "c_opt=" +set "ld_opt=" diff --git a/win95/microsft/vpp40/mk70.bat b/win95/microsft/vpp40/mk70.bat index 2cb01b4..f3c587b 100644 --- a/win95/microsft/vpp40/mk70.bat +++ b/win95/microsft/vpp40/mk70.bat @@ -16,6 +16,7 @@ set "ld_opt=-ltcg" if exist objects rd /S /Q objects if exist config.h del config.h if exist dmake.exe del dmake.exe +if exist dmake.pdb del dmake.pdb md objects %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\infer.obj infer.c %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\make.obj make.c @@ -43,7 +44,7 @@ md objects %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\arlib.obj msdos\arlib.c %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\dirbrk.obj msdos\dirbrk.c rem Not needed for MSVC 6 and up. Lesser versions not supported -rem cl -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\tempnam.obj tempnam.c +rem %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\tempnam.obj tempnam.c %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\ruletab.obj win95\microsft\ruletab.c %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\runargv.obj unix\runargv.c %cc% -c %c_flg% -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo %c_opt% -Zi -Foobjects\rmprq.obj unix\rmprq.c diff --git a/win95/microsft/vpp40/public.h b/win95/microsft/vpp40/public.h index dea051d..cbdf666 100644 --- a/win95/microsft/vpp40/public.h +++ b/win95/microsft/vpp40/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -127,7 +127,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/win95/switchar.c b/win95/switchar.c index 6daae26..bc63f0e 100644 --- a/win95/switchar.c +++ b/win95/switchar.c @@ -23,9 +23,7 @@ -- Use cvs log to obtain detailed change logs. */ -#include -#include -#include "stdmacs.h" +#include "extern.h" getswitchar()/* =============== diff --git a/winnt/borland/bcc50/public.h b/winnt/borland/bcc50/public.h index 9ea12ef..d414df5 100644 --- a/winnt/borland/bcc50/public.h +++ b/winnt/borland/bcc50/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -128,7 +128,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/winnt/microsft/config.h b/winnt/microsft/config.h index 23fd1da..c2d4dd5 100644 --- a/winnt/microsft/config.h +++ b/winnt/microsft/config.h @@ -25,10 +25,14 @@ -- Use cvs log to obtain detailed change logs. */ -/* Name and version number of this package */ -#define PACKAGE "dmake" -#define VERSION "4.12" -#define BUILDINFO "Windows / MS Visual C++" +/* Attention! In the UNIX like builds with the ./configure ; make + procedure a config.h is generated. The autogenerated config.h + must not be there to compile dmake with MSC and the + "dmake\make.bat win95-vpp40" command. This file sets (among other + things) the needed HAS_... and HAVE_... macros. + + Don't forget to update the PACKAGE and VERSION macros! +*/ #if defined (_MSC_VER) # if _MSC_VER < 500 @@ -73,10 +77,105 @@ # define CONST #endif +/* Build info string */ +#define BUILDINFO "Windows / MS Visual C++ " dmstr2(_MSC_FULL_VER) + +/* Assume case insensitive file system. */ +#define CASE_INSENSITIVE_FS 1 + + +/* These functions are available! (this is tested only with MSVC++ 6.0) */ +#define HAVE_UTIME_NULL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `setvbuf' function. */ +#define HAVE_SETVBUF 1 + +/* These defines are needed for itypes.h! (this is tested only with MSVC++ 6.0) */ +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlwr' function. */ +#define HAVE_STRLWR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tempnam' function. */ +#define HAVE_TEMPNAM 1 + +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Name of package */ +#define PACKAGE "dmake" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "dmake" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "dmake 4.13" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "dmake" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.13" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + #ifndef MSDOS # define MSDOS 1 #endif +/* Version number of package */ +#define VERSION "4.13" + /* a small problem with pointer to voids on some unix machines needs this */ #define DMPVOID void * diff --git a/winnt/microsft/sysintf.h b/winnt/microsft/sysintf.h index 07e9d7f..2f5a5a5 100644 --- a/winnt/microsft/sysintf.h +++ b/winnt/microsft/sysintf.h @@ -47,3 +47,7 @@ extern char * getcwd(); #undef _POSIX_PATH_MAX #endif #define _POSIX_PATH_MAX _MAX_PATH + +#if _MSC_VER >= 1400 +# define fputc(_c,_stream) _fputc_nolock(_c,_stream) +#endif diff --git a/winnt/microsft/vpp40/public.h b/winnt/microsft/vpp40/public.h index ad8e5e0..d71aa61 100644 --- a/winnt/microsft/vpp40/public.h +++ b/winnt/microsft/vpp40/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -127,7 +127,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/winnt/mingw/public.h b/winnt/mingw/public.h index ce7cd6b..e6712e3 100644 --- a/winnt/mingw/public.h +++ b/winnt/mingw/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -127,7 +127,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/winnt/mingw/sysintf.h b/winnt/mingw/sysintf.h index bbb6ef0..4ee4f10 100644 --- a/winnt/mingw/sysintf.h +++ b/winnt/mingw/sysintf.h @@ -52,3 +52,5 @@ extern char * getcwd(); #undef _POSIX_PATH_MAX #endif #define _POSIX_PATH_MAX _MAX_PATH + +#define fputc(_c,_stream) _fputc_nolock(_c,_stream) diff --git a/winnt/msvc6/public.h b/winnt/msvc6/public.h index 2f1a793..50f5750 100644 --- a/winnt/msvc6/public.h +++ b/winnt/msvc6/public.h @@ -59,7 +59,7 @@ 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 Append_line ANSI((char *, int, FILE *, int, int)); void Stat_target ANSI((CELLPTR, int, int)); char *Expand ANSI((char *)); char *Apply_edit ANSI((char *, char *, char *, int, int)); @@ -127,7 +127,7 @@ 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 Close_temp ANSI((CELLPTR, FILE *, char *)); void Unlink_temp_files ANSI((CELLPTR)); void Handle_result ANSI((int, int, int, CELLPTR)); void Update_time_stamp ANSI((CELLPTR)); diff --git a/winnt/msvc6/sysintf.h b/winnt/msvc6/sysintf.h index a41fa6f..b5225a4 100644 --- a/winnt/msvc6/sysintf.h +++ b/winnt/msvc6/sysintf.h @@ -52,3 +52,7 @@ extern char * getcwd(); #undef _POSIX_PATH_MAX #endif #define _POSIX_PATH_MAX _MAX_PATH + +#if _MSC_VER >= 1400 +# define fputc(_c,_stream) _fputc_nolock(_c,_stream) +#endif