xref: /titanic_51/usr/src/cmd/make/bin/globals.cc (revision 10d63b7db37a83b39c7f511cf9426c9d03ea0760)
1*10d63b7dSRichard Lowe /*
2*10d63b7dSRichard Lowe  * CDDL HEADER START
3*10d63b7dSRichard Lowe  *
4*10d63b7dSRichard Lowe  * The contents of this file are subject to the terms of the
5*10d63b7dSRichard Lowe  * Common Development and Distribution License (the "License").
6*10d63b7dSRichard Lowe  * You may not use this file except in compliance with the License.
7*10d63b7dSRichard Lowe  *
8*10d63b7dSRichard Lowe  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*10d63b7dSRichard Lowe  * or http://www.opensolaris.org/os/licensing.
10*10d63b7dSRichard Lowe  * See the License for the specific language governing permissions
11*10d63b7dSRichard Lowe  * and limitations under the License.
12*10d63b7dSRichard Lowe  *
13*10d63b7dSRichard Lowe  * When distributing Covered Code, include this CDDL HEADER in each
14*10d63b7dSRichard Lowe  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*10d63b7dSRichard Lowe  * If applicable, add the following below this CDDL HEADER, with the
16*10d63b7dSRichard Lowe  * fields enclosed by brackets "[]" replaced with your own identifying
17*10d63b7dSRichard Lowe  * information: Portions Copyright [yyyy] [name of copyright owner]
18*10d63b7dSRichard Lowe  *
19*10d63b7dSRichard Lowe  * CDDL HEADER END
20*10d63b7dSRichard Lowe  */
21*10d63b7dSRichard Lowe /*
22*10d63b7dSRichard Lowe  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23*10d63b7dSRichard Lowe  * Use is subject to license terms.
24*10d63b7dSRichard Lowe  */
25*10d63b7dSRichard Lowe 
26*10d63b7dSRichard Lowe /*
27*10d63b7dSRichard Lowe  *	globals.cc
28*10d63b7dSRichard Lowe  *
29*10d63b7dSRichard Lowe  *	This declares all global variables
30*10d63b7dSRichard Lowe  */
31*10d63b7dSRichard Lowe 
32*10d63b7dSRichard Lowe /*
33*10d63b7dSRichard Lowe  * Included files
34*10d63b7dSRichard Lowe  */
35*10d63b7dSRichard Lowe #include <nl_types.h>
36*10d63b7dSRichard Lowe #include <mk/defs.h>
37*10d63b7dSRichard Lowe #include <sys/stat.h>
38*10d63b7dSRichard Lowe 
39*10d63b7dSRichard Lowe /*
40*10d63b7dSRichard Lowe  * Defined macros
41*10d63b7dSRichard Lowe  */
42*10d63b7dSRichard Lowe 
43*10d63b7dSRichard Lowe /*
44*10d63b7dSRichard Lowe  * typedefs & structs
45*10d63b7dSRichard Lowe  */
46*10d63b7dSRichard Lowe 
47*10d63b7dSRichard Lowe /*
48*10d63b7dSRichard Lowe  * Global variables used by make only
49*10d63b7dSRichard Lowe  */
50*10d63b7dSRichard Lowe 	FILE		*dependency_report_file;
51*10d63b7dSRichard Lowe 
52*10d63b7dSRichard Lowe /*
53*10d63b7dSRichard Lowe  * Global variables used by make
54*10d63b7dSRichard Lowe  */
55*10d63b7dSRichard Lowe 	Boolean		allrules_read=false;
56*10d63b7dSRichard Lowe 	Name		posix_name;
57*10d63b7dSRichard Lowe 	Name		svr4_name;
58*10d63b7dSRichard Lowe 	Boolean		sdot_target;	/* used to identify s.m(/M)akefile */
59*10d63b7dSRichard Lowe 	Boolean		all_parallel;
60*10d63b7dSRichard Lowe 	Boolean		assign_done;
61*10d63b7dSRichard Lowe 	int foo;
62*10d63b7dSRichard Lowe 	Boolean		build_failed_seen;
63*10d63b7dSRichard Lowe 	Name		built_last_make_run;
64*10d63b7dSRichard Lowe 	Name		c_at;
65*10d63b7dSRichard Lowe 	Boolean		cleanup;
66*10d63b7dSRichard Lowe 	Boolean		close_report;
67*10d63b7dSRichard Lowe 	Boolean		command_changed;
68*10d63b7dSRichard Lowe 	Boolean		commands_done;
69*10d63b7dSRichard Lowe 	Chain		conditional_targets;
70*10d63b7dSRichard Lowe 	Name		conditionals;
71*10d63b7dSRichard Lowe 	Boolean		continue_after_error;		/* `-k' */
72*10d63b7dSRichard Lowe 	Property	current_line;
73*10d63b7dSRichard Lowe 	Name		current_make_version;
74*10d63b7dSRichard Lowe 	Name		current_target;
75*10d63b7dSRichard Lowe 	short		debug_level;
76*10d63b7dSRichard Lowe 	Cmd_line	default_rule;
77*10d63b7dSRichard Lowe 	Name		default_rule_name;
78*10d63b7dSRichard Lowe 	Name		default_target_to_build;
79*10d63b7dSRichard Lowe 	Name		dmake_group;
80*10d63b7dSRichard Lowe 	Name		dmake_max_jobs;
81*10d63b7dSRichard Lowe 	Name		dmake_mode;
82*10d63b7dSRichard Lowe 	DMake_mode	dmake_mode_type;
83*10d63b7dSRichard Lowe 	Name		dmake_output_mode;
84*10d63b7dSRichard Lowe 	DMake_output_mode	output_mode = txt1_mode;
85*10d63b7dSRichard Lowe 	Name		dmake_odir;
86*10d63b7dSRichard Lowe 	Name		dmake_rcfile;
87*10d63b7dSRichard Lowe 	Name		done;
88*10d63b7dSRichard Lowe 	Name		dot;
89*10d63b7dSRichard Lowe 	Name		dot_keep_state;
90*10d63b7dSRichard Lowe 	Name		dot_keep_state_file;
91*10d63b7dSRichard Lowe 	Name		empty_name;
92*10d63b7dSRichard Lowe 	Boolean		fatal_in_progress;
93*10d63b7dSRichard Lowe 	int		file_number;
94*10d63b7dSRichard Lowe #if 0
95*10d63b7dSRichard Lowe 	Boolean		filter_stderr;			/* `-X' */
96*10d63b7dSRichard Lowe #endif
97*10d63b7dSRichard Lowe 	Name		force;
98*10d63b7dSRichard Lowe 	Name		ignore_name;
99*10d63b7dSRichard Lowe 	Boolean		ignore_errors;			/* `-i' */
100*10d63b7dSRichard Lowe 	Boolean		ignore_errors_all;		/* `-i' */
101*10d63b7dSRichard Lowe 	Name		init;
102*10d63b7dSRichard Lowe 	int		job_msg_id;
103*10d63b7dSRichard Lowe 	Boolean		keep_state;
104*10d63b7dSRichard Lowe 	Name		make_state;
105*10d63b7dSRichard Lowe 	timestruc_t	make_state_before;
106*10d63b7dSRichard Lowe 	Dependency	makefiles_used;
107*10d63b7dSRichard Lowe 	Name		makeflags;
108*10d63b7dSRichard Lowe //	Boolean		make_state_locked; // Moved to lib/mksh
109*10d63b7dSRichard Lowe 	Name		make_version;
110*10d63b7dSRichard Lowe 	char		mbs_buffer2[(MAXPATHLEN * MB_LEN_MAX)];
111*10d63b7dSRichard Lowe 	char		*mbs_ptr;
112*10d63b7dSRichard Lowe 	char		*mbs_ptr2;
113*10d63b7dSRichard Lowe 	Boolean		depinfo_already_read = false;
114*10d63b7dSRichard Lowe 	Boolean		no_action_was_taken = true;	/* true if we've not **
115*10d63b7dSRichard Lowe 							** run any command   */
116*10d63b7dSRichard Lowe 
117*10d63b7dSRichard Lowe 	Boolean		no_parallel = false;
118*10d63b7dSRichard Lowe 	Name		no_parallel_name;
119*10d63b7dSRichard Lowe 	Name		not_auto;
120*10d63b7dSRichard Lowe 	Boolean		only_parallel;
121*10d63b7dSRichard Lowe 	Boolean		parallel;
122*10d63b7dSRichard Lowe 	Name		parallel_name;
123*10d63b7dSRichard Lowe 	Name		localhost_name;
124*10d63b7dSRichard Lowe 	int		parallel_process_cnt;
125*10d63b7dSRichard Lowe 	Percent		percent_list;
126*10d63b7dSRichard Lowe 	Dyntarget	dyntarget_list;
127*10d63b7dSRichard Lowe 	Name		plus;
128*10d63b7dSRichard Lowe 	Name		pmake_machinesfile;
129*10d63b7dSRichard Lowe 	Name		precious;
130*10d63b7dSRichard Lowe         Name		primary_makefile;
131*10d63b7dSRichard Lowe 	Boolean		quest;				/* `-q' */
132*10d63b7dSRichard Lowe 	short		read_trace_level;
133*10d63b7dSRichard Lowe         Boolean 	reading_dependencies = false;
134*10d63b7dSRichard Lowe 	Name		recursive_name;
135*10d63b7dSRichard Lowe 	int		recursion_level;
136*10d63b7dSRichard Lowe 	short		report_dependencies_level = 0;	/* -P */
137*10d63b7dSRichard Lowe 	Boolean		report_pwd;
138*10d63b7dSRichard Lowe 	Boolean		rewrite_statefile;
139*10d63b7dSRichard Lowe 	Running		running_list;
140*10d63b7dSRichard Lowe 	char		*sccs_dir_path;
141*10d63b7dSRichard Lowe 	Name		sccs_get_name;
142*10d63b7dSRichard Lowe 	Name		sccs_get_posix_name;
143*10d63b7dSRichard Lowe 	Cmd_line	sccs_get_rule;
144*10d63b7dSRichard Lowe 	Cmd_line	sccs_get_org_rule;
145*10d63b7dSRichard Lowe 	Cmd_line	sccs_get_posix_rule;
146*10d63b7dSRichard Lowe 	Name		get_name;
147*10d63b7dSRichard Lowe 	Cmd_line	get_rule;
148*10d63b7dSRichard Lowe 	Name		get_posix_name;
149*10d63b7dSRichard Lowe 	Cmd_line	get_posix_rule;
150*10d63b7dSRichard Lowe 	Boolean		all_precious;
151*10d63b7dSRichard Lowe 	Boolean		silent_all;			/* `-s' */
152*10d63b7dSRichard Lowe 	Boolean		report_cwd;			/* `-w' */
153*10d63b7dSRichard Lowe 	Boolean		silent;				/* `-s' */
154*10d63b7dSRichard Lowe 	Name		silent_name;
155*10d63b7dSRichard Lowe 	char		*stderr_file = NULL;
156*10d63b7dSRichard Lowe 	char		*stdout_file = NULL;
157*10d63b7dSRichard Lowe 	Boolean		stdout_stderr_same;
158*10d63b7dSRichard Lowe 	Dependency	suffixes;
159*10d63b7dSRichard Lowe 	Name		suffixes_name;
160*10d63b7dSRichard Lowe 	Name		sunpro_dependencies;
161*10d63b7dSRichard Lowe         Boolean		target_variants;
162*10d63b7dSRichard Lowe 	const char	*tmpdir = "/tmp";
163*10d63b7dSRichard Lowe 	const char	*temp_file_directory = ".";
164*10d63b7dSRichard Lowe 	Name		temp_file_name;
165*10d63b7dSRichard Lowe 	short		temp_file_number;
166*10d63b7dSRichard Lowe 	time_t		timing_start;
167*10d63b7dSRichard Lowe 	wchar_t		*top_level_target;
168*10d63b7dSRichard Lowe 	Boolean		touch;				/* `-t' */
169*10d63b7dSRichard Lowe 	Boolean		trace_reader;			/* `-D' */
170*10d63b7dSRichard Lowe 	Boolean		build_unconditional;		/* `-u' */
171*10d63b7dSRichard Lowe 	pathpt		vroot_path = VROOT_DEFAULT;
172*10d63b7dSRichard Lowe 	Name		wait_name;
173*10d63b7dSRichard Lowe 	wchar_t		wcs_buffer2[MAXPATHLEN];
174*10d63b7dSRichard Lowe 	wchar_t		*wcs_ptr;
175*10d63b7dSRichard Lowe 	wchar_t		*wcs_ptr2;
176*10d63b7dSRichard Lowe 	long int	hostid;
177*10d63b7dSRichard Lowe 
178*10d63b7dSRichard Lowe /*
179*10d63b7dSRichard Lowe  * File table of contents
180*10d63b7dSRichard Lowe  */
181*10d63b7dSRichard Lowe 
182