xref: /illumos-gate/usr/src/cmd/make/include/mk/defs.h (revision 8e0c8248)
110d63b7dSRichard Lowe /*
210d63b7dSRichard Lowe  * CDDL HEADER START
310d63b7dSRichard Lowe  *
410d63b7dSRichard Lowe  * The contents of this file are subject to the terms of the
510d63b7dSRichard Lowe  * Common Development and Distribution License (the "License").
610d63b7dSRichard Lowe  * You may not use this file except in compliance with the License.
710d63b7dSRichard Lowe  *
810d63b7dSRichard Lowe  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
910d63b7dSRichard Lowe  * or http://www.opensolaris.org/os/licensing.
1010d63b7dSRichard Lowe  * See the License for the specific language governing permissions
1110d63b7dSRichard Lowe  * and limitations under the License.
1210d63b7dSRichard Lowe  *
1310d63b7dSRichard Lowe  * When distributing Covered Code, include this CDDL HEADER in each
1410d63b7dSRichard Lowe  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1510d63b7dSRichard Lowe  * If applicable, add the following below this CDDL HEADER, with the
1610d63b7dSRichard Lowe  * fields enclosed by brackets "[]" replaced with your own identifying
1710d63b7dSRichard Lowe  * information: Portions Copyright [yyyy] [name of copyright owner]
1810d63b7dSRichard Lowe  *
1910d63b7dSRichard Lowe  * CDDL HEADER END
2010d63b7dSRichard Lowe  */
2110d63b7dSRichard Lowe /*
2210d63b7dSRichard Lowe  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
2310d63b7dSRichard Lowe  * Use is subject to license terms.
2436cd0120SRobert Mustacchi  *
2536cd0120SRobert Mustacchi  * Copyright 2019, Joyent, Inc.
26*8e0c8248SAndrew Stormont  * Copyright 2019 RackTop Systems.
2710d63b7dSRichard Lowe  */
2810d63b7dSRichard Lowe 
292e8f3c34SToomas Soome #ifndef _MK_DEFS_H
302e8f3c34SToomas Soome #define	_MK_DEFS_H
312e8f3c34SToomas Soome 
3210d63b7dSRichard Lowe /*
3310d63b7dSRichard Lowe  * Included files
3410d63b7dSRichard Lowe  */
3510d63b7dSRichard Lowe 
3610d63b7dSRichard Lowe #include <mksh/defs.h>
3710d63b7dSRichard Lowe 
3810d63b7dSRichard Lowe /*
3910d63b7dSRichard Lowe  * Defined macros
4010d63b7dSRichard Lowe  */
4110d63b7dSRichard Lowe 
422e8f3c34SToomas Soome #define	SKIPSPACE(x)	while (*x &&				\
432e8f3c34SToomas Soome 				((*x == (int)space_char) ||	\
442e8f3c34SToomas Soome 				(*x == (int)tab_char) ||	\
452e8f3c34SToomas Soome 				(*x == (int)comma_char))) {	\
4610d63b7dSRichard Lowe 					x++;			\
4710d63b7dSRichard Lowe 			}
4810d63b7dSRichard Lowe 
492e8f3c34SToomas Soome #define	SKIPWORD(x)	while (*x &&				\
502e8f3c34SToomas Soome 				(*x != (int)space_char) &&	\
512e8f3c34SToomas Soome 				(*x != (int)tab_char) &&	\
522e8f3c34SToomas Soome 				(*x != (int)newline_char) &&	\
532e8f3c34SToomas Soome 				(*x != (int)comma_char) &&	\
542e8f3c34SToomas Soome 				(*x != (int)equal_char)) {	\
5510d63b7dSRichard Lowe 					x++;			\
5610d63b7dSRichard Lowe 			}
5710d63b7dSRichard Lowe 
582e8f3c34SToomas Soome #define	SKIPTOEND(x)	while (*x &&				\
592e8f3c34SToomas Soome 				(*x != (int)newline_char)) {	\
6010d63b7dSRichard Lowe 					x++;			\
6110d63b7dSRichard Lowe 			}
6210d63b7dSRichard Lowe 
632e8f3c34SToomas Soome #define	PMAKE_DEF_MAX_JOBS	2	/* Default number of parallel jobs. */
6410d63b7dSRichard Lowe 
652e8f3c34SToomas Soome #define	OUT_OF_DATE(a, b) \
662e8f3c34SToomas Soome 	(((a) < (b)) || (((a) == file_doesnt_exist) && \
672e8f3c34SToomas Soome 	((b) == file_doesnt_exist)))
6810d63b7dSRichard Lowe 
692e8f3c34SToomas Soome #define	OUT_OF_DATE_SEC(a, b) \
702e8f3c34SToomas Soome 	(((a).tv_sec < (b).tv_sec) || \
712e8f3c34SToomas Soome 	(((a).tv_sec == file_doesnt_exist.tv_sec) && \
722e8f3c34SToomas Soome 	((b).tv_sec == file_doesnt_exist.tv_sec)))
7310d63b7dSRichard Lowe 
742e8f3c34SToomas Soome #define	SETVAR(name, value, append) \
7510d63b7dSRichard Lowe 				setvar_daemon(name, value, append, no_daemon, \
762e8f3c34SToomas Soome 				true, debug_level)
772e8f3c34SToomas Soome #define	MAX(a, b)		(((a) > (b))?(a):(b))
7810d63b7dSRichard Lowe /*
7910d63b7dSRichard Lowe  * New feature added to SUN5_0 make,  invoke the vanilla svr4 make when
8010d63b7dSRichard Lowe  * the USE_SVR4_MAKE environment variable is set.
8110d63b7dSRichard Lowe  */
822e8f3c34SToomas Soome #define	SVR4_MAKE		"/usr/ccs/lib/svr4.make"
832e8f3c34SToomas Soome #define	USE_SVR4_MAKE		"USE_SVR4_MAKE"
8410d63b7dSRichard Lowe /*
8510d63b7dSRichard Lowe  * The standard MAXHOSTNAMELEN is 64. We want 32.
8610d63b7dSRichard Lowe  */
8710d63b7dSRichard Lowe #define	MAX_HOSTNAMELEN		32
8810d63b7dSRichard Lowe 
8910d63b7dSRichard Lowe 
9010d63b7dSRichard Lowe /*
9110d63b7dSRichard Lowe  * typedefs & structs
9210d63b7dSRichard Lowe  */
9310d63b7dSRichard Lowe typedef enum {
9410d63b7dSRichard Lowe 	no_state,
9510d63b7dSRichard Lowe 	scan_name_state,
9610d63b7dSRichard Lowe 	scan_command_state,
9710d63b7dSRichard Lowe 	enter_dependencies_state,
9810d63b7dSRichard Lowe 	enter_conditional_state,
9910d63b7dSRichard Lowe 	enter_equal_state,
10010d63b7dSRichard Lowe 	illegal_bytes_state,
10110d63b7dSRichard Lowe 	illegal_eoln_state,
10210d63b7dSRichard Lowe 	poorly_formed_macro_state,
10310d63b7dSRichard Lowe 	exit_state
1042e8f3c34SToomas Soome } Reader_state;
10510d63b7dSRichard Lowe 
10610d63b7dSRichard Lowe struct _Name_vector {
10710d63b7dSRichard Lowe 	struct _Name		*names[64];
10810d63b7dSRichard Lowe 	struct _Chain		*target_group[64];
1092e8f3c34SToomas Soome 	short			used;
11010d63b7dSRichard Lowe 	struct _Name_vector	*next;
11110d63b7dSRichard Lowe };
11210d63b7dSRichard Lowe 
11310d63b7dSRichard Lowe struct _Running {
11410d63b7dSRichard Lowe 	struct _Running		*next;
11510d63b7dSRichard Lowe 	Doname			state;
11610d63b7dSRichard Lowe 	struct _Name		*target;
11710d63b7dSRichard Lowe 	struct _Name		*true_target;
11810d63b7dSRichard Lowe 	struct _Property	*command;
11910d63b7dSRichard Lowe 	struct _Name		*sprodep_value;
12010d63b7dSRichard Lowe 	char			*sprodep_env;
12110d63b7dSRichard Lowe 	int			recursion_level;
12210d63b7dSRichard Lowe 	Boolean			do_get;
12310d63b7dSRichard Lowe 	Boolean			implicit;
12410d63b7dSRichard Lowe 	Boolean			redo;
12510d63b7dSRichard Lowe 	int			auto_count;
12610d63b7dSRichard Lowe 	struct _Name		**automatics;
12710d63b7dSRichard Lowe 	pid_t			pid;
12810d63b7dSRichard Lowe 	int			job_msg_id;
12910d63b7dSRichard Lowe 	char			*stdout_file;
13010d63b7dSRichard Lowe 	char			*stderr_file;
13110d63b7dSRichard Lowe 	struct _Name		*temp_file;
13210d63b7dSRichard Lowe 	int			conditional_cnt;
13310d63b7dSRichard Lowe 	struct _Name		**conditional_targets;
13410d63b7dSRichard Lowe 	Boolean			make_refd;
13510d63b7dSRichard Lowe };
13610d63b7dSRichard Lowe 
13710d63b7dSRichard Lowe typedef enum {
13810d63b7dSRichard Lowe 	serial_mode,
13910d63b7dSRichard Lowe 	parallel_mode
14010d63b7dSRichard Lowe } DMake_mode;
14110d63b7dSRichard Lowe 
14210d63b7dSRichard Lowe typedef enum {
14310d63b7dSRichard Lowe 	txt1_mode,
14410d63b7dSRichard Lowe 	txt2_mode,
14510d63b7dSRichard Lowe 	html1_mode
14610d63b7dSRichard Lowe } DMake_output_mode;
14710d63b7dSRichard Lowe 
14810d63b7dSRichard Lowe struct _Recursive_make {
1492e8f3c34SToomas Soome 	struct _Recursive_make	*next;	  /* Linked list */
1502e8f3c34SToomas Soome 	wchar_t			*target;  /* Name of target */
1512e8f3c34SToomas Soome 	wchar_t			*oldline; /* Original line in .nse_depinfo */
1522e8f3c34SToomas Soome 	wchar_t			*newline; /* New line in .nse_depinfo */
1532e8f3c34SToomas Soome 	/*
1542e8f3c34SToomas Soome 	 * string built from value of
1552e8f3c34SToomas Soome 	 * conditional macros used by
1562e8f3c34SToomas Soome 	 * this target
1572e8f3c34SToomas Soome 	 */
15810d63b7dSRichard Lowe 	wchar_t			*cond_macrostring;
1592e8f3c34SToomas Soome 	/* This target is no longer recursive */
1602e8f3c34SToomas Soome 	Boolean			removed;
16110d63b7dSRichard Lowe };
16210d63b7dSRichard Lowe 
16310d63b7dSRichard Lowe struct _Dyntarget {
16410d63b7dSRichard Lowe 	struct _Dyntarget	*next;
16510d63b7dSRichard Lowe 	struct _Name		*name;
16610d63b7dSRichard Lowe };
16710d63b7dSRichard Lowe 
16810d63b7dSRichard Lowe 
16910d63b7dSRichard Lowe /*
17010d63b7dSRichard Lowe  * Typedefs for all structs
17110d63b7dSRichard Lowe  */
17210d63b7dSRichard Lowe typedef struct _Cmd_line	*Cmd_line, Cmd_line_rec;
17310d63b7dSRichard Lowe typedef struct _Dependency	*Dependency, Dependency_rec;
17410d63b7dSRichard Lowe typedef struct _Macro		*Macro, Macro_rec;
17510d63b7dSRichard Lowe typedef struct _Name_vector	*Name_vector, Name_vector_rec;
17610d63b7dSRichard Lowe typedef struct _Percent		*Percent, Percent_rec;
17710d63b7dSRichard Lowe typedef struct _Dyntarget	*Dyntarget;
17810d63b7dSRichard Lowe typedef struct _Recursive_make	*Recursive_make, Recursive_make_rec;
17910d63b7dSRichard Lowe typedef struct _Running		*Running, Running_rec;
18010d63b7dSRichard Lowe 
18110d63b7dSRichard Lowe 
18210d63b7dSRichard Lowe /*
18310d63b7dSRichard Lowe  *	extern declarations for all global variables.
18410d63b7dSRichard Lowe  *	The actual declarations are in globals.cc
18510d63b7dSRichard Lowe  */
18610d63b7dSRichard Lowe extern	Boolean		allrules_read;
18710d63b7dSRichard Lowe extern	Name		posix_name;
18810d63b7dSRichard Lowe extern	Name		svr4_name;
18910d63b7dSRichard Lowe extern	Boolean		sdot_target;
19010d63b7dSRichard Lowe extern	Boolean		all_parallel;
19110d63b7dSRichard Lowe extern	Boolean		assign_done;
19210d63b7dSRichard Lowe extern	Boolean		build_failed_seen;
19310d63b7dSRichard Lowe extern	Name		built_last_make_run;
19410d63b7dSRichard Lowe extern	Name		c_at;
19510d63b7dSRichard Lowe extern	Boolean		command_changed;
19610d63b7dSRichard Lowe extern	Boolean		commands_done;
19710d63b7dSRichard Lowe extern	Chain		conditional_targets;
19810d63b7dSRichard Lowe extern	Name		conditionals;
19910d63b7dSRichard Lowe extern	Boolean		continue_after_error;
20010d63b7dSRichard Lowe extern	Property	current_line;
20110d63b7dSRichard Lowe extern	Name		current_make_version;
20210d63b7dSRichard Lowe extern	Name		current_target;
20310d63b7dSRichard Lowe extern	short		debug_level;
20410d63b7dSRichard Lowe extern	Cmd_line	default_rule;
20510d63b7dSRichard Lowe extern	Name		default_rule_name;
20610d63b7dSRichard Lowe extern	Name		default_target_to_build;
20710d63b7dSRichard Lowe extern	Boolean		depinfo_already_read;
20810d63b7dSRichard Lowe extern	Name		dmake_group;
20910d63b7dSRichard Lowe extern	Name		dmake_max_jobs;
21010d63b7dSRichard Lowe extern	Name		dmake_mode;
21110d63b7dSRichard Lowe extern	DMake_mode	dmake_mode_type;
21210d63b7dSRichard Lowe extern	Name		dmake_output_mode;
21310d63b7dSRichard Lowe extern	DMake_output_mode	output_mode;
21410d63b7dSRichard Lowe extern	Name		dmake_odir;
21510d63b7dSRichard Lowe extern	Name		dmake_rcfile;
21610d63b7dSRichard Lowe extern	Name		done;
21710d63b7dSRichard Lowe extern	Name		dot;
21810d63b7dSRichard Lowe extern	Name		dot_keep_state;
21910d63b7dSRichard Lowe extern	Name		dot_keep_state_file;
22010d63b7dSRichard Lowe extern	Name		empty_name;
22110d63b7dSRichard Lowe extern	Boolean		fatal_in_progress;
22210d63b7dSRichard Lowe extern	int		file_number;
22310d63b7dSRichard Lowe extern	Name		force;
22410d63b7dSRichard Lowe extern	Name		ignore_name;
22510d63b7dSRichard Lowe extern	Boolean		ignore_errors;
22610d63b7dSRichard Lowe extern	Boolean		ignore_errors_all;
22710d63b7dSRichard Lowe extern	Name		init;
22810d63b7dSRichard Lowe extern	int		job_msg_id;
22910d63b7dSRichard Lowe extern	Boolean		keep_state;
23010d63b7dSRichard Lowe extern	Name		make_state;
23110d63b7dSRichard Lowe extern	timestruc_t	make_state_before;
23210d63b7dSRichard Lowe extern	Boolean		make_state_locked;
23310d63b7dSRichard Lowe extern	Dependency	makefiles_used;
23410d63b7dSRichard Lowe extern	Name		makeflags;
23510d63b7dSRichard Lowe extern	Name		make_version;
23610d63b7dSRichard Lowe extern	char		mbs_buffer2[];
23710d63b7dSRichard Lowe extern	char		*mbs_ptr;
23810d63b7dSRichard Lowe extern	char		*mbs_ptr2;
23910d63b7dSRichard Lowe extern	Boolean		no_action_was_taken;
24010d63b7dSRichard Lowe extern	Boolean		no_parallel;
24110d63b7dSRichard Lowe extern	Name		no_parallel_name;
24210d63b7dSRichard Lowe extern	Name		not_auto;
24310d63b7dSRichard Lowe extern	Boolean		only_parallel;
24410d63b7dSRichard Lowe extern	Boolean		parallel;
24510d63b7dSRichard Lowe extern	Name		parallel_name;
24610d63b7dSRichard Lowe extern	Name		localhost_name;
24710d63b7dSRichard Lowe extern	int		parallel_process_cnt;
24810d63b7dSRichard Lowe extern	Percent		percent_list;
24910d63b7dSRichard Lowe extern	Dyntarget	dyntarget_list;
25010d63b7dSRichard Lowe extern	Name		plus;
25110d63b7dSRichard Lowe extern	Name		pmake_machinesfile;
25210d63b7dSRichard Lowe extern	Name		precious;
25310d63b7dSRichard Lowe extern	Name		primary_makefile;
25410d63b7dSRichard Lowe extern	Boolean		quest;
25510d63b7dSRichard Lowe extern	short		read_trace_level;
25610d63b7dSRichard Lowe extern	Boolean		reading_dependencies;
25710d63b7dSRichard Lowe extern	int		recursion_level;
25810d63b7dSRichard Lowe extern	Name		recursive_name;
25910d63b7dSRichard Lowe extern	short		report_dependencies_level;
26010d63b7dSRichard Lowe extern	Boolean		report_pwd;
26110d63b7dSRichard Lowe extern	Boolean		rewrite_statefile;
26210d63b7dSRichard Lowe extern	Running		running_list;
26310d63b7dSRichard Lowe extern	char		*sccs_dir_path;
26410d63b7dSRichard Lowe extern	Name		sccs_get_name;
26510d63b7dSRichard Lowe extern	Name		sccs_get_posix_name;
26610d63b7dSRichard Lowe extern	Cmd_line	sccs_get_rule;
26710d63b7dSRichard Lowe extern	Cmd_line	sccs_get_org_rule;
26810d63b7dSRichard Lowe extern	Cmd_line	sccs_get_posix_rule;
26910d63b7dSRichard Lowe extern	Name		get_name;
27010d63b7dSRichard Lowe extern	Name		get_posix_name;
27110d63b7dSRichard Lowe extern	Cmd_line	get_rule;
27210d63b7dSRichard Lowe extern	Cmd_line	get_posix_rule;
27310d63b7dSRichard Lowe extern	Boolean		all_precious;
27410d63b7dSRichard Lowe extern	Boolean		report_cwd;
27510d63b7dSRichard Lowe extern	Boolean		silent_all;
27610d63b7dSRichard Lowe extern	Boolean		silent;
27710d63b7dSRichard Lowe extern	Name		silent_name;
27810d63b7dSRichard Lowe extern	char		*stderr_file;
27910d63b7dSRichard Lowe extern	char		*stdout_file;
28010d63b7dSRichard Lowe extern	Boolean		stdout_stderr_same;
28110d63b7dSRichard Lowe extern	Dependency	suffixes;
28210d63b7dSRichard Lowe extern	Name		suffixes_name;
28310d63b7dSRichard Lowe extern	Name		sunpro_dependencies;
28410d63b7dSRichard Lowe extern	Boolean		target_variants;
28510d63b7dSRichard Lowe extern	const char	*tmpdir;
28610d63b7dSRichard Lowe extern	const char	*temp_file_directory;
28710d63b7dSRichard Lowe extern	Name		temp_file_name;
28810d63b7dSRichard Lowe extern	short		temp_file_number;
28910d63b7dSRichard Lowe extern  wchar_t		*top_level_target;
29010d63b7dSRichard Lowe extern	Boolean		touch;
29110d63b7dSRichard Lowe extern	Boolean		trace_reader;
29210d63b7dSRichard Lowe extern	Boolean		build_unconditional;
29310d63b7dSRichard Lowe extern	pathpt		vroot_path;
29410d63b7dSRichard Lowe extern	Name		wait_name;
29510d63b7dSRichard Lowe extern	wchar_t		wcs_buffer2[];
29610d63b7dSRichard Lowe extern	wchar_t		*wcs_ptr;
29710d63b7dSRichard Lowe extern	wchar_t		*wcs_ptr2;
29810d63b7dSRichard Lowe extern	long int	hostid;
29936cd0120SRobert Mustacchi extern	Boolean		path_reset;
30036cd0120SRobert Mustacchi extern	Boolean		rebuild_arg0;
30110d63b7dSRichard Lowe 
30210d63b7dSRichard Lowe /*
30310d63b7dSRichard Lowe  * Declarations of system defined variables
30410d63b7dSRichard Lowe  */
30510d63b7dSRichard Lowe /* On linux this variable is defined in 'signal.h' */
30610d63b7dSRichard Lowe extern	char		*sys_siglist[];
30710d63b7dSRichard Lowe 
30810d63b7dSRichard Lowe /*
30910d63b7dSRichard Lowe  * Declarations of system supplied functions
31010d63b7dSRichard Lowe  */
31110d63b7dSRichard Lowe extern	int		file_lock(char *, char *, int *, int);
31210d63b7dSRichard Lowe 
31310d63b7dSRichard Lowe /*
31410d63b7dSRichard Lowe  * Declarations of functions declared and used by make
31510d63b7dSRichard Lowe  */
3162e8f3c34SToomas Soome extern	void		add_pending(Name target, int recursion_level,
3172e8f3c34SToomas Soome 	Boolean do_get, Boolean implicit, Boolean redo);
3182e8f3c34SToomas Soome extern	void		add_running(Name target, Name true_target,
3192e8f3c34SToomas Soome 	Property command, int recursion_level, int auto_count,
3202e8f3c34SToomas Soome 	Name *automatics, Boolean do_get, Boolean implicit);
3212e8f3c34SToomas Soome extern	void		add_serial(Name target, int recursion_level,
3222e8f3c34SToomas Soome 	Boolean do_get, Boolean implicit);
3232e8f3c34SToomas Soome extern	void		add_subtree(Name target, int recursion_level,
3242e8f3c34SToomas Soome 	Boolean do_get, Boolean implicit);
3252e8f3c34SToomas Soome extern  void		append_or_replace_macro_in_dyn_array(
3262e8f3c34SToomas Soome 	ASCII_Dyn_Array *Ar, char *macro);
32710d63b7dSRichard Lowe extern	void		await_parallel(Boolean waitflg);
32810d63b7dSRichard Lowe extern	void		build_suffix_list(Name target_suffix);
3292e8f3c34SToomas Soome extern	Boolean		check_auto_dependencies(Name target, int auto_count,
3302e8f3c34SToomas Soome 	Name *automatics);
33110d63b7dSRichard Lowe extern	void		check_state(Name temp_file_name);
33210d63b7dSRichard Lowe extern	void		cond_macros_into_string(Name np, String_rec *buffer);
33310d63b7dSRichard Lowe extern	void		construct_target_string();
33410d63b7dSRichard Lowe extern	void		create_xdrs_ptr(void);
3352e8f3c34SToomas Soome extern	void		depvar_add_to_list(Name name, Boolean cmdline);
3362e8f3c34SToomas Soome extern	Doname		doname(Name target, Boolean do_get, Boolean implicit,
3372e8f3c34SToomas Soome 	Boolean automatic = false);
3382e8f3c34SToomas Soome extern	Doname		doname_check(Name target, Boolean do_get,
3392e8f3c34SToomas Soome 	Boolean implicit, Boolean automatic);
3402e8f3c34SToomas Soome extern	Doname		doname_parallel(Name target, Boolean do_get,
3412e8f3c34SToomas Soome 	Boolean implicit);
3422e8f3c34SToomas Soome extern	Doname		dosys(Name command, Boolean ignore_error,
3432e8f3c34SToomas Soome 	Boolean call_make, Boolean silent_error, Boolean always_exec,
3442e8f3c34SToomas Soome 	Name target);
34510d63b7dSRichard Lowe extern	void		dump_make_state(void);
34610d63b7dSRichard Lowe extern	void		dump_target_list(void);
3472e8f3c34SToomas Soome extern	void		enter_conditional(Name target, Name name, Name value,
3482e8f3c34SToomas Soome 	Boolean append);
3492e8f3c34SToomas Soome extern	void		enter_dependencies(Name target, Chain target_group,
3502e8f3c34SToomas Soome 	Name_vector depes, Cmd_line command, Separator separator);
3512e8f3c34SToomas Soome extern	void		enter_dependency(Property line, Name depe,
3522e8f3c34SToomas Soome 	Boolean automatic);
3532e8f3c34SToomas Soome extern	void		enter_equal(Name name, Name value, Boolean append);
3542e8f3c34SToomas Soome extern  Percent		enter_percent(Name target, Chain target_group,
3552e8f3c34SToomas Soome 	Name_vector depes, Cmd_line command);
3562e8f3c34SToomas Soome extern	Dyntarget	enter_dyntarget(Name target);
3572e8f3c34SToomas Soome extern	Name_vector	enter_name(String string, Boolean tail_present,
3582e8f3c34SToomas Soome 	wchar_t *string_start, wchar_t *string_end, Name_vector current_names,
3592e8f3c34SToomas Soome 	Name_vector *extra_names, Boolean *target_group_seen);
3602e8f3c34SToomas Soome extern	Boolean		exec_vp(char *name, char **argv, char **envp,
3612e8f3c34SToomas Soome 	Boolean ignore_error);
3622e8f3c34SToomas Soome extern	Doname		execute_parallel(Property line, Boolean waitflg,
3632e8f3c34SToomas Soome 	Boolean local = false);
36410d63b7dSRichard Lowe extern	Doname		execute_serial(Property line);
3652e8f3c34SToomas Soome extern	timestruc_t&	exists(Name target);
3662e8f3c34SToomas Soome extern	void		fatal(const char *, ...) __NORETURN;
367*8e0c8248SAndrew Stormont extern	void		fatal_reader(char *, ...) __NORETURN;
3682e8f3c34SToomas Soome extern	Doname		find_ar_suffix_rule(Name target, Name true_target,
3692e8f3c34SToomas Soome 	Property *command, Boolean rechecking);
3702e8f3c34SToomas Soome extern	Doname		find_double_suffix_rule(Name target, Property *command,
3712e8f3c34SToomas Soome 	Boolean rechecking);
3722e8f3c34SToomas Soome extern	Doname		find_percent_rule(Name target, Property *command,
3732e8f3c34SToomas Soome 	Boolean rechecking);
3742e8f3c34SToomas Soome extern	int		find_run_directory(char *cmd, char *cwd, char *dir,
3752e8f3c34SToomas Soome 	char **pgm, char **run, char *path);
3762e8f3c34SToomas Soome extern	Doname		find_suffix_rule(Name target, Name target_body,
3772e8f3c34SToomas Soome 	Name target_suffix, Property *command, Boolean rechecking);
3782e8f3c34SToomas Soome extern	Chain		find_target_groups(Name_vector target_list, int i,
3792e8f3c34SToomas Soome 	Boolean reset);
38010d63b7dSRichard Lowe extern	void		finish_children(Boolean docheck);
38110d63b7dSRichard Lowe extern	void		finish_running(void);
38210d63b7dSRichard Lowe extern	void		free_chain(Name_vector ptr);
38310d63b7dSRichard Lowe extern  void		gather_recursive_deps(void);
38410d63b7dSRichard Lowe extern	char		*get_current_path(void);
38510d63b7dSRichard Lowe extern	int		get_job_msg_id(void);
3862e8f3c34SToomas Soome extern	wchar_t		*getmem_wc(int size);
38710d63b7dSRichard Lowe extern	void		handle_interrupt(int);
38810d63b7dSRichard Lowe extern	Boolean		is_running(Name target);
38910d63b7dSRichard Lowe extern	void		load_cached_names(void);
39010d63b7dSRichard Lowe extern	Boolean		parallel_ok(Name target, Boolean line_prop_must_exists);
3912e8f3c34SToomas Soome extern	void		print_dependencies(Name target, Property line);
39210d63b7dSRichard Lowe extern	void		send_job_start_msg(Property line);
3932e8f3c34SToomas Soome extern	void		send_rsrc_info_msg(int max_jobs, char *hostname,
3942e8f3c34SToomas Soome 	char *username);
3952e8f3c34SToomas Soome extern	void		print_value(Name value, Daemon daemon);
3962e8f3c34SToomas Soome extern	timestruc_t&	read_archive(Name target);
3972e8f3c34SToomas Soome extern	int		read_dir(Name dir, wchar_t *pattern, Property line,
3982e8f3c34SToomas Soome 	wchar_t *library);
3992e8f3c34SToomas Soome extern	void		read_directory_of_file(Name file);
40010d63b7dSRichard Lowe extern	int		read_make_machines(Name make_machines_name);
4012e8f3c34SToomas Soome extern	Boolean		read_simple_file(Name makefile_name, Boolean chase_path,
4022e8f3c34SToomas Soome 	Boolean doname_it, Boolean complain, Boolean must_exist,
4032e8f3c34SToomas Soome 	Boolean report_file, Boolean lock_makefile);
40410d63b7dSRichard Lowe extern	void		remove_recursive_dep(Name target);
40510d63b7dSRichard Lowe extern	void		report_recursive_dep(Name target, char *line);
40610d63b7dSRichard Lowe extern	void		report_recursive_done(void);
40710d63b7dSRichard Lowe extern	void		report_recursive_init(void);
40810d63b7dSRichard Lowe extern	Recursive_make	find_recursive_target(Name target);
4092e8f3c34SToomas Soome extern	void		reset_locals(Name target, Property old_locals,
4102e8f3c34SToomas Soome 	Property conditional, int index);
4112e8f3c34SToomas Soome extern	void		set_locals(Name target, Property old_locals);
4122e8f3c34SToomas Soome extern	void		setvar_append(Name name, Name value);
41310d63b7dSRichard Lowe extern	void		setvar_envvar(void);
4142e8f3c34SToomas Soome extern	void		special_reader(Name target, Name_vector depes,
4152e8f3c34SToomas Soome 	Cmd_line command);
41610d63b7dSRichard Lowe extern	void		startup_rxm();
4172e8f3c34SToomas Soome extern	Doname		target_can_be_built(Name target);
41810d63b7dSRichard Lowe extern	char		*time_to_string(const timestruc_t &time);
41910d63b7dSRichard Lowe extern	void		update_target(Property line, Doname result);
42010d63b7dSRichard Lowe extern	void		warning(char *, ...);
42110d63b7dSRichard Lowe extern	void		write_state_file(int report_recursive, Boolean exiting);
4222e8f3c34SToomas Soome extern	Name		vpath_translation(Name cmd);
4232e8f3c34SToomas Soome extern	char		*make_install_prefix(void);
42410d63b7dSRichard Lowe 
4252e8f3c34SToomas Soome #define	DEPINFO_FMT_VERSION "VERS2$"
4262e8f3c34SToomas Soome #define	VER_LEN strlen(DEPINFO_FMT_VERSION)
42710d63b7dSRichard Lowe 
42810d63b7dSRichard Lowe 
4292e8f3c34SToomas Soome #endif	/* _MK_DEFS_H */
430