make(1): fix initialization order of modules (broken since today)

In CLEANUP mode, Var_Init depends on Targ_Init since the variable scopes
are implemented as GNodes.

By the way, since 1999-09-15 variables are no longer stored in lists but
in hash tables.
This commit is contained in:
rillig 2020-11-16 22:08:20 +00:00
parent 5f6b9ee03e
commit a13421bf80

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.475 2020/11/16 18:28:27 rillig Exp $ */
/* $NetBSD: main.c,v 1.476 2020/11/16 22:08:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -109,7 +109,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
MAKE_RCSID("$NetBSD: main.c,v 1.475 2020/11/16 18:28:27 rillig Exp $");
MAKE_RCSID("$NetBSD: main.c,v 1.476 2020/11/16 22:08:20 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@ -1382,8 +1382,8 @@ main_Init(int argc, char **argv)
/*
* Just in case MAKEOBJDIR wants us to do something tricky.
*/
Var_Init(); /* Initialize the lists of variables for
* parsing arguments */
Targ_Init();
Var_Init();
Var_Set(".MAKE.OS", utsname.sysname, VAR_GLOBAL);
Var_Set("MACHINE", machine, VAR_GLOBAL);
Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL);
@ -1505,7 +1505,6 @@ main_Init(int argc, char **argv)
* parsing the makefile(s)
*/
Arch_Init();
Targ_Init();
Suff_Init();
Trace_Init(tracefile);