mirror of
https://github.com/mirror/make.git
synced 2025-01-16 15:20:39 +08:00
Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* 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()
This commit is contained in:
parent
7431536bed
commit
c8484a6170
33
main.c
33
main.c
@ -24,6 +24,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#ifdef _AMIGA
|
||||||
|
# include <dos/dos.h>
|
||||||
|
# include <proto/dos.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _AMIGA
|
||||||
|
int __stack = 20000; /* Make sure we have 20K of stack space */
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void init_dir PARAMS ((void));
|
extern void init_dir PARAMS ((void));
|
||||||
extern RETSIGTYPE fatal_error_signal PARAMS ((int sig));
|
extern RETSIGTYPE fatal_error_signal PARAMS ((int sig));
|
||||||
@ -584,17 +592,12 @@ int main (int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
if (fib.fib_DirEntryType < 0) /* File */
|
if (fib.fib_DirEntryType < 0) /* File */
|
||||||
{
|
{
|
||||||
file = Open (fib.fib_FileName, MODE_OLDFILE);
|
/* Define an empty variable. It will be filled in
|
||||||
|
variable_lookup(). Makes startup quite a bit
|
||||||
if (file)
|
faster. */
|
||||||
{
|
|
||||||
len = Read (file, buffer, sizeof (buffer)-1);
|
|
||||||
buffer[len] = 0;
|
|
||||||
|
|
||||||
define_variable (fib.fib_FileName,
|
define_variable (fib.fib_FileName,
|
||||||
strlen (fib.fib_FileName),
|
strlen (fib.fib_FileName),
|
||||||
buffer, o_env, 1)->export = v_export;
|
"", o_env, 1)->export = v_export;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UnLock (env);
|
UnLock (env);
|
||||||
@ -746,7 +749,6 @@ int main (int argc, char ** argv)
|
|||||||
starting_directory = current_directory;
|
starting_directory = current_directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Read any stdin makefiles into temporary files. */
|
/* Read any stdin makefiles into temporary files. */
|
||||||
|
|
||||||
if (makefiles != 0)
|
if (makefiles != 0)
|
||||||
@ -1120,14 +1122,17 @@ int main (int argc, char ** argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else /* AMIGA */
|
#else /* AMIGA */
|
||||||
# include <dos/dos.h>
|
|
||||||
# include <proto/dos.h>
|
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
len = GetVar ("MAKELEVEL", buffer, sizeof (buffer), GVF_GLOBAL_ONLY);
|
||||||
|
|
||||||
|
if (len != -1)
|
||||||
|
{
|
||||||
sprintf (buffer, "%u", makelevel);
|
sprintf (buffer, "%u", makelevel);
|
||||||
SetVar ("MAKELEVEL", buffer, -1, GVF_LOCAL_ONLY);
|
SetVar ("MAKELEVEL", buffer, -1, GVF_GLOBAL_ONLY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1864,7 +1869,6 @@ define_makeflags (all, makefile)
|
|||||||
flags = flags->next;
|
flags = flags->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Define MFLAGS before appending variable definitions. */
|
/* Define MFLAGS before appending variable definitions. */
|
||||||
|
|
||||||
if (p == &flagstring[1])
|
if (p == &flagstring[1])
|
||||||
@ -1881,7 +1885,6 @@ define_makeflags (all, makefile)
|
|||||||
override any makefile redefinition. */
|
override any makefile redefinition. */
|
||||||
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
||||||
|
|
||||||
|
|
||||||
if (all && command_variables != 0)
|
if (all && command_variables != 0)
|
||||||
{
|
{
|
||||||
/* Now write a reference to $(MAKEOVERRIDES), which contains all the
|
/* Now write a reference to $(MAKEOVERRIDES), which contains all the
|
||||||
|
Loading…
Reference in New Issue
Block a user