set ARCH=x64\r
set DEBUG=N\r
\r
+if exist maintMakefile (\r
+ set MAINT=Y\r
+) else (\r
+ set MAINT=N\r
+)\r
+\r
:ParseSW\r
if "%1" == "--debug" goto SetDebug\r
if "%1" == "--without-guile" goto NoGuile\r
goto ParseSW\r
\r
:DoneSW\r
+if "%MAINT%" == "Y" echo - Enabling maintainer mode\r
+\r
if "%COMPILER%" == "gcc" goto FindGcc\r
\r
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.\r
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug\r
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"\r
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG\r
+if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"\r
:: Show the compiler version that we found\r
:: Unfortunately this also shows a "usage" note; I can't find anything better.\r
echo.\r
set OPTS=-O2\r
if "%DEBUG%" == "Y" set OPTS=-O0\r
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug\r
+if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"\r
:: Show the compiler version that we found\r
echo.\r
%COMPILER% --version\r
char *output_sync_option = 0;
-#ifdef WINDOWS32
-/* Suspend make in main for a short time to allow debugger to attach */
-
-int suspend_flag = 0;
-#endif
-
/* Environment variables override makefile definitions. */
int env_overrides = 0;
{ 'b', ignore, 0, 0, 0, 0, 0, 0, 0 },
{ 'B', flag, &always_make_set, 1, 1, 0, 0, 0, "always-make" },
{ 'd', flag, &debug_flag, 1, 1, 0, 0, 0, 0 },
-#ifdef WINDOWS32
- { 'D', flag, &suspend_flag, 1, 1, 0, 0, 0, "suspend-for-debug" },
-#endif
{ 'e', flag, &env_overrides, 1, 1, 0, 0, 0, "environment-overrides", },
{ 'E', strlist, &eval_strings, 1, 0, 0, 0, 0, "eval" },
{ 'h', flag, &print_usage_flag, 0, 0, 0, 0, 0, "help" },
no_default_sh_exe = 1;
#endif
+ /* Useful for attaching debuggers, etc. */
+ SPIN ("main-entry");
+
output_init (&make_sync);
initialize_stopchar_map();
#endif
#ifdef MAKE_LOAD
" load"
+#endif
+#ifdef MAKE_MAINTAINER_MODE
+ " maintainer"
#endif
;
makelevel = 0;
}
-#ifdef WINDOWS32
- if (suspend_flag)
- {
- fprintf (stderr, "%s (pid = %ld)\n", argv[0], GetCurrentProcessId ());
- fprintf (stderr, _("%s is suspending for 30 seconds..."), argv[0]);
- Sleep (30 * 1000);
- fprintf (stderr, _("done sleep(30). Continuing.\n"));
- }
-#endif
-
/* Set always_make_flag if -B was given and we've not restarted already. */
always_make_flag = always_make_set && (restarts == 0);
int load_file (const floc *flocp, const char **filename, int noerror);
void unload_file (const char *name);
+/* Maintainer mode support */
+#ifdef MAKE_MAINTAINER_MODE
+# define SPIN(_s) spin (_s)
+void spin (const char* suffix);
+#else
+# define SPIN(_s)
+#endif
+
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
because such systems often declare them in header files anyway. */
extern int handling_fatal_signal;
-
#ifndef MIN
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
#endif
-
#define MAKE_SUCCESS 0
#define MAKE_TROUBLE 1
#define MAKE_FAILURE 2
}
\f
+#ifdef MAKE_MAINTAINER_MODE
+
+void spin(const char* type)
+{
+ char filenm[256];
+ struct stat dummy;
+
+ sprintf (filenm, ".make-spin-%s", type);
+
+ if (stat (filenm, &dummy) == 0)
+ {
+ fprintf (stderr, "SPIN on %s\n", filenm);
+ do
+ sleep (1);
+ while (stat (filenm, &dummy) == 0);
+ }
+}
+
+#endif
+
+\f
+
/* Provide support for temporary files. */
#ifndef HAVE_STDLIB_H