From c8484a6170338873143f21b2051f64aed6280a49 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 13 May 1996 18:40:11 +0000 Subject: Sun May 12 19:19:43 1996 Aaron Digulla * main.c: (main), variable.c Changed handling of ENV-vars. Make stores now the names of the variables only and reads their contents when they are accessed to reflect that these variables are really global (ie. they CAN change WHILE make runs !) This handling is made in lookup_variable() --- main.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d16e7f4..c3f8089 100644 --- a/main.c +++ b/main.c @@ -24,6 +24,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "commands.h" #include "getopt.h" #include +#ifdef _AMIGA +# include +# include +#endif + +#ifdef _AMIGA +int __stack = 20000; /* Make sure we have 20K of stack space */ +#endif extern void init_dir PARAMS ((void)); extern RETSIGTYPE fatal_error_signal PARAMS ((int sig)); @@ -584,17 +592,12 @@ int main (int argc, char ** argv) { if (fib.fib_DirEntryType < 0) /* File */ { - file = Open (fib.fib_FileName, MODE_OLDFILE); - - if (file) - { - len = Read (file, buffer, sizeof (buffer)-1); - buffer[len] = 0; - + /* Define an empty variable. It will be filled in + variable_lookup(). Makes startup quite a bit + faster. */ define_variable (fib.fib_FileName, strlen (fib.fib_FileName), - buffer, o_env, 1)->export = v_export; - } + "", o_env, 1)->export = v_export; } } UnLock (env); @@ -746,7 +749,6 @@ int main (int argc, char ** argv) starting_directory = current_directory; } - /* Read any stdin makefiles into temporary files. */ if (makefiles != 0) @@ -1120,14 +1122,17 @@ int main (int argc, char ** argv) break; } #else /* AMIGA */ -# include -# include { char buffer[256]; int len; + len = GetVar ("MAKELEVEL", buffer, sizeof (buffer), GVF_GLOBAL_ONLY); + + if (len != -1) + { sprintf (buffer, "%u", makelevel); - SetVar ("MAKELEVEL", buffer, -1, GVF_LOCAL_ONLY); + SetVar ("MAKELEVEL", buffer, -1, GVF_GLOBAL_ONLY); + } } #endif @@ -1864,7 +1869,6 @@ define_makeflags (all, makefile) flags = flags->next; } - /* Define MFLAGS before appending variable definitions. */ if (p == &flagstring[1]) @@ -1881,7 +1885,6 @@ define_makeflags (all, makefile) override any makefile redefinition. */ (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1); - if (all && command_variables != 0) { /* Now write a reference to $(MAKEOVERRIDES), which contains all the -- cgit v1.2.3