Print this page
make: unifdef for MAKETOOL and DISTRIBUTED (undefined)


  11  * or http://www.opensolaris.org/os/licensing.
  12  * See the License for the specific language governing permissions
  13  * and limitations under the License.
  14  *
  15  * When distributing Covered Code, include this CDDL HEADER in each
  16  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17  * If applicable, add the following below this CDDL HEADER, with the
  18  * fields enclosed by brackets "[]" replaced with your own identifying
  19  * information: Portions Copyright [yyyy] [name of copyright owner]
  20  *
  21  * CDDL HEADER END
  22  */
  23 /*
  24  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 /*
  29  * Included files
  30  */
  31 #ifdef DISTRIBUTED
  32 #       include <dm/Avo_AcknowledgeMsg.h>
  33 #       include <dm/Avo_DoJobMsg.h>
  34 #       include <dm/Avo_JobResultMsg.h>
  35 #endif
  36 
  37 #include <mksh/defs.h>
  38 
  39 #if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
  40 #       include <rw/xdrstrea.h>
  41 #endif
  42 
  43 
  44 /*
  45  * Defined macros
  46  */
  47 
  48 #define SKIPSPACE(x)    while (*x &&                            \
  49                                ((*x == (int) space_char) ||     \
  50                                 (*x == (int) tab_char) ||       \
  51                                 (*x == (int) comma_char))) {    \
  52                                         x++;                    \
  53                         }
  54 
  55 #define SKIPWORD(x)     while (*x &&                            \
  56                                (*x != (int) space_char) &&      \
  57                                (*x != (int) tab_char) &&        \
  58                                (*x != (int) newline_char) &&    \
  59                                (*x != (int) comma_char) &&      \
  60                                (*x != (int) equal_char)) {      \
  61                                         x++;                    \


 181 typedef struct _Dependency      *Dependency, Dependency_rec;
 182 typedef struct _Macro           *Macro, Macro_rec;
 183 typedef struct _Name_vector     *Name_vector, Name_vector_rec;
 184 typedef struct _Percent         *Percent, Percent_rec;
 185 typedef struct _Dyntarget       *Dyntarget;
 186 typedef struct _Recursive_make  *Recursive_make, Recursive_make_rec;
 187 typedef struct _Running         *Running, Running_rec;
 188 
 189 
 190 /*
 191  *      extern declarations for all global variables.
 192  *      The actual declarations are in globals.cc
 193  */
 194 extern  Boolean         allrules_read;
 195 extern  Name            posix_name;
 196 extern  Name            svr4_name;
 197 extern  Boolean         sdot_target;
 198 extern  Boolean         all_parallel;
 199 extern  Boolean         assign_done;
 200 extern  Boolean         build_failed_seen;
 201 #ifdef DISTRIBUTED
 202 extern  Boolean         building_serial;
 203 #endif
 204 extern  Name            built_last_make_run;
 205 extern  Name            c_at;
 206 #ifdef DISTRIBUTED
 207 extern  Boolean         called_make;
 208 #endif
 209 extern  Boolean         command_changed;
 210 extern  Boolean         commands_done;
 211 extern  Chain           conditional_targets;
 212 extern  Name            conditionals;
 213 extern  Boolean         continue_after_error;
 214 extern  Property        current_line;
 215 extern  Name            current_make_version;
 216 extern  Name            current_target;
 217 extern  short           debug_level;
 218 extern  Cmd_line        default_rule;
 219 extern  Name            default_rule_name;
 220 extern  Name            default_target_to_build;
 221 extern  Boolean         depinfo_already_read;
 222 extern  Name            dmake_group;
 223 extern  Name            dmake_max_jobs;
 224 extern  Name            dmake_mode;
 225 extern  DMake_mode      dmake_mode_type;
 226 extern  Name            dmake_output_mode;
 227 extern  DMake_output_mode       output_mode;
 228 extern  Name            dmake_odir;


 318 
 319 /*
 320  * Declarations of system defined variables
 321  */
 322 /* On linux this variable is defined in 'signal.h' */
 323 extern  char            *sys_siglist[];
 324 
 325 /*
 326  * Declarations of system supplied functions
 327  */
 328 extern  int             file_lock(char *, char *, int *, int);
 329 
 330 /*
 331  * Declarations of functions declared and used by make
 332  */
 333 extern  void            add_pending(Name target, int recursion_level, Boolean do_get, Boolean implicit, Boolean redo);
 334 extern  void            add_running(Name target, Name true_target, Property command, int recursion_level, int auto_count, Name *automatics, Boolean do_get, Boolean implicit);
 335 extern  void            add_serial(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 336 extern  void            add_subtree(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 337 extern  void            append_or_replace_macro_in_dyn_array(ASCII_Dyn_Array *Ar, char *macro);
 338 #ifdef DISTRIBUTED
 339 extern  Doname          await_dist(Boolean waitflg);
 340 #endif
 341 #ifdef TEAMWARE_MAKE_CMN
 342 extern  void            await_parallel(Boolean waitflg);
 343 #endif
 344 extern  void            build_suffix_list(Name target_suffix);
 345 extern  Boolean         check_auto_dependencies(Name target, int auto_count, Name *automatics);
 346 extern  void            check_state(Name temp_file_name);
 347 extern  void            cond_macros_into_string(Name np, String_rec *buffer);
 348 extern  void            construct_target_string();
 349 extern  void            create_xdrs_ptr(void);
 350 extern  void            depvar_add_to_list (Name name, Boolean cmdline);
 351 #ifdef DISTRIBUTED
 352 extern  void            distribute_rxm(Avo_DoJobMsg *dmake_job_msg);
 353 extern  int             getRxmMessage(void);
 354 extern  Avo_JobResultMsg* getJobResultMsg(void);
 355 extern  Avo_AcknowledgeMsg* getAcknowledgeMsg(void);
 356 #endif
 357 extern  Doname          doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic = false);
 358 extern  Doname          doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
 359 extern  Doname          doname_parallel(Name target, Boolean do_get, Boolean implicit);
 360 extern  Doname          dosys(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target, Boolean redirect_out_err);
 361 extern  void            dump_make_state(void);
 362 extern  void            dump_target_list(void);
 363 extern  void            enter_conditional(register Name target, Name name, Name value, register Boolean append);
 364 extern  void            enter_dependencies(register Name target, Chain target_group, register Name_vector depes, register Cmd_line command, register Separator separator);
 365 extern  void            enter_dependency(Property line, register Name depe, Boolean automatic);
 366 extern  void            enter_equal(Name name, Name value, register Boolean append);
 367 extern  Percent         enter_percent(register Name target, Chain target_group, register Name_vector depes, Cmd_line command);
 368 extern  Dyntarget       enter_dyntarget(register Name target);
 369 extern  Name_vector     enter_name(String string, Boolean tail_present, register wchar_t *string_start, register wchar_t *string_end, Name_vector current_names, Name_vector *extra_names, Boolean *target_group_seen);
 370 extern  Boolean         exec_vp(register char *name, register char **argv, char **envp, register Boolean ignore_error);
 371 extern  Doname          execute_parallel(Property line, Boolean waitflg, Boolean local = false);
 372 extern  Doname          execute_serial(Property line);
 373 extern  timestruc_t&        exists(register Name target);
 374 extern  void            fatal(const char *, ...);
 375 extern  void            fatal_reader(char *, ...);
 376 extern  Doname          find_ar_suffix_rule(register Name target, Name true_target, Property *command, Boolean rechecking);
 377 extern  Doname          find_double_suffix_rule(register Name target, Property *command, Boolean rechecking);
 378 extern  Doname          find_percent_rule(register Name target, Property *command, Boolean rechecking);
 379 extern  int             find_run_directory (char *cmd, char *cwd, char *dir, char **pgm, char **run, char *path);
 380 extern  Doname          find_suffix_rule(Name target, Name target_body, Name target_suffix, Property *command, Boolean rechecking);
 381 extern  Chain           find_target_groups(register Name_vector target_list, register int i, Boolean reset);
 382 extern  void            finish_children(Boolean docheck);
 383 extern  void            finish_running(void);
 384 extern  void            free_chain(Name_vector ptr);
 385 extern  void            gather_recursive_deps(void);
 386 extern  char            *get_current_path(void);
 387 extern  int             get_job_msg_id(void);
 388 extern  FILE            *get_mtool_msgs_fp(void);
 389 #ifdef DISTRIBUTED
 390 extern  Boolean         get_dmake_group_specified(void);
 391 extern  Boolean         get_dmake_max_jobs_specified(void);
 392 extern  Boolean         get_dmake_mode_specified(void);
 393 extern  Boolean         get_dmake_odir_specified(void);
 394 extern  Boolean         get_dmake_rcfile_specified(void);
 395 extern  Boolean         get_pmake_machinesfile_specified(void);
 396 #endif
 397 #if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
 398 extern  XDR             *get_xdrs_ptr(void);
 399 #endif
 400 extern  wchar_t         *getmem_wc(register int size);
 401 /* On linux getwd(char *) is defined in 'unistd.h' */
 402 #ifdef __cplusplus
 403 extern "C" {
 404 #endif
 405 extern  char            *getwd(char *);
 406 #ifdef __cplusplus
 407 }
 408 #endif
 409 extern  void            handle_interrupt(int);
 410 extern  Boolean         is_running(Name target);
 411 extern  void            load_cached_names(void);
 412 extern  Boolean         parallel_ok(Name target, Boolean line_prop_must_exists);
 413 extern  void            print_dependencies(register Name target, register Property line);
 414 extern  void            send_job_start_msg(Property line);
 415 extern  void            send_rsrc_info_msg(int max_jobs, char *hostname, char *username);
 416 extern  void            print_value(register Name value, Daemon daemon);
 417 extern  timestruc_t&        read_archive(register Name target);
 418 extern  int             read_dir(Name dir, wchar_t *pattern, Property line, wchar_t *library);
 419 extern  void            read_directory_of_file(register Name file);
 420 extern  int             read_make_machines(Name make_machines_name);
 421 extern  Boolean         read_simple_file(register Name makefile_name, register Boolean chase_path, register Boolean doname_it, Boolean complain, Boolean must_exist, Boolean report_file, Boolean lock_makefile);
 422 extern  void            remove_recursive_dep(Name target);
 423 extern  void            report_recursive_dep(Name target, char *line);
 424 extern  void            report_recursive_done(void);
 425 extern  void            report_recursive_init(void);
 426 extern  Recursive_make  find_recursive_target(Name target);
 427 extern  void            reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
 428 extern  void            set_locals(register Name target, register Property old_locals);
 429 extern  void            setvar_append(register Name name, register Name value);
 430 #ifdef DISTRIBUTED
 431 extern  void            setvar_envvar(Avo_DoJobMsg *dmake_job_msg);
 432 #else
 433 extern  void            setvar_envvar(void);
 434 #endif
 435 extern  void            special_reader(Name target, register Name_vector depes, Cmd_line command);
 436 extern  void            startup_rxm();
 437 extern  Doname          target_can_be_built(register Name target);
 438 extern  char            *time_to_string(const timestruc_t &time);
 439 extern  void            update_target(Property line, Doname result);
 440 extern  void            warning(char *, ...);
 441 extern  void            write_state_file(int report_recursive, Boolean exiting);
 442 extern  Name            vpath_translation(register Name cmd);
 443 
 444 #define DEPINFO_FMT_VERSION "VERS2$"
 445 #define VER_LEN strlen(DEPINFO_FMT_VERSION)
 446 
 447 
 448 #endif


  11  * or http://www.opensolaris.org/os/licensing.
  12  * See the License for the specific language governing permissions
  13  * and limitations under the License.
  14  *
  15  * When distributing Covered Code, include this CDDL HEADER in each
  16  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17  * If applicable, add the following below this CDDL HEADER, with the
  18  * fields enclosed by brackets "[]" replaced with your own identifying
  19  * information: Portions Copyright [yyyy] [name of copyright owner]
  20  *
  21  * CDDL HEADER END
  22  */
  23 /*
  24  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  25  * Use is subject to license terms.
  26  */
  27 
  28 /*
  29  * Included files
  30  */





  31 
  32 #include <mksh/defs.h>
  33 



  34 
  35 
  36 /*
  37  * Defined macros
  38  */
  39 
  40 #define SKIPSPACE(x)    while (*x &&                            \
  41                                ((*x == (int) space_char) ||     \
  42                                 (*x == (int) tab_char) ||       \
  43                                 (*x == (int) comma_char))) {    \
  44                                         x++;                    \
  45                         }
  46 
  47 #define SKIPWORD(x)     while (*x &&                            \
  48                                (*x != (int) space_char) &&      \
  49                                (*x != (int) tab_char) &&        \
  50                                (*x != (int) newline_char) &&    \
  51                                (*x != (int) comma_char) &&      \
  52                                (*x != (int) equal_char)) {      \
  53                                         x++;                    \


 173 typedef struct _Dependency      *Dependency, Dependency_rec;
 174 typedef struct _Macro           *Macro, Macro_rec;
 175 typedef struct _Name_vector     *Name_vector, Name_vector_rec;
 176 typedef struct _Percent         *Percent, Percent_rec;
 177 typedef struct _Dyntarget       *Dyntarget;
 178 typedef struct _Recursive_make  *Recursive_make, Recursive_make_rec;
 179 typedef struct _Running         *Running, Running_rec;
 180 
 181 
 182 /*
 183  *      extern declarations for all global variables.
 184  *      The actual declarations are in globals.cc
 185  */
 186 extern  Boolean         allrules_read;
 187 extern  Name            posix_name;
 188 extern  Name            svr4_name;
 189 extern  Boolean         sdot_target;
 190 extern  Boolean         all_parallel;
 191 extern  Boolean         assign_done;
 192 extern  Boolean         build_failed_seen;



 193 extern  Name            built_last_make_run;
 194 extern  Name            c_at;



 195 extern  Boolean         command_changed;
 196 extern  Boolean         commands_done;
 197 extern  Chain           conditional_targets;
 198 extern  Name            conditionals;
 199 extern  Boolean         continue_after_error;
 200 extern  Property        current_line;
 201 extern  Name            current_make_version;
 202 extern  Name            current_target;
 203 extern  short           debug_level;
 204 extern  Cmd_line        default_rule;
 205 extern  Name            default_rule_name;
 206 extern  Name            default_target_to_build;
 207 extern  Boolean         depinfo_already_read;
 208 extern  Name            dmake_group;
 209 extern  Name            dmake_max_jobs;
 210 extern  Name            dmake_mode;
 211 extern  DMake_mode      dmake_mode_type;
 212 extern  Name            dmake_output_mode;
 213 extern  DMake_output_mode       output_mode;
 214 extern  Name            dmake_odir;


 304 
 305 /*
 306  * Declarations of system defined variables
 307  */
 308 /* On linux this variable is defined in 'signal.h' */
 309 extern  char            *sys_siglist[];
 310 
 311 /*
 312  * Declarations of system supplied functions
 313  */
 314 extern  int             file_lock(char *, char *, int *, int);
 315 
 316 /*
 317  * Declarations of functions declared and used by make
 318  */
 319 extern  void            add_pending(Name target, int recursion_level, Boolean do_get, Boolean implicit, Boolean redo);
 320 extern  void            add_running(Name target, Name true_target, Property command, int recursion_level, int auto_count, Name *automatics, Boolean do_get, Boolean implicit);
 321 extern  void            add_serial(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 322 extern  void            add_subtree(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 323 extern  void            append_or_replace_macro_in_dyn_array(ASCII_Dyn_Array *Ar, char *macro);



 324 #ifdef TEAMWARE_MAKE_CMN
 325 extern  void            await_parallel(Boolean waitflg);
 326 #endif
 327 extern  void            build_suffix_list(Name target_suffix);
 328 extern  Boolean         check_auto_dependencies(Name target, int auto_count, Name *automatics);
 329 extern  void            check_state(Name temp_file_name);
 330 extern  void            cond_macros_into_string(Name np, String_rec *buffer);
 331 extern  void            construct_target_string();
 332 extern  void            create_xdrs_ptr(void);
 333 extern  void            depvar_add_to_list (Name name, Boolean cmdline);






 334 extern  Doname          doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic = false);
 335 extern  Doname          doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
 336 extern  Doname          doname_parallel(Name target, Boolean do_get, Boolean implicit);
 337 extern  Doname          dosys(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target, Boolean redirect_out_err);
 338 extern  void            dump_make_state(void);
 339 extern  void            dump_target_list(void);
 340 extern  void            enter_conditional(register Name target, Name name, Name value, register Boolean append);
 341 extern  void            enter_dependencies(register Name target, Chain target_group, register Name_vector depes, register Cmd_line command, register Separator separator);
 342 extern  void            enter_dependency(Property line, register Name depe, Boolean automatic);
 343 extern  void            enter_equal(Name name, Name value, register Boolean append);
 344 extern  Percent         enter_percent(register Name target, Chain target_group, register Name_vector depes, Cmd_line command);
 345 extern  Dyntarget       enter_dyntarget(register Name target);
 346 extern  Name_vector     enter_name(String string, Boolean tail_present, register wchar_t *string_start, register wchar_t *string_end, Name_vector current_names, Name_vector *extra_names, Boolean *target_group_seen);
 347 extern  Boolean         exec_vp(register char *name, register char **argv, char **envp, register Boolean ignore_error);
 348 extern  Doname          execute_parallel(Property line, Boolean waitflg, Boolean local = false);
 349 extern  Doname          execute_serial(Property line);
 350 extern  timestruc_t&        exists(register Name target);
 351 extern  void            fatal(const char *, ...);
 352 extern  void            fatal_reader(char *, ...);
 353 extern  Doname          find_ar_suffix_rule(register Name target, Name true_target, Property *command, Boolean rechecking);
 354 extern  Doname          find_double_suffix_rule(register Name target, Property *command, Boolean rechecking);
 355 extern  Doname          find_percent_rule(register Name target, Property *command, Boolean rechecking);
 356 extern  int             find_run_directory (char *cmd, char *cwd, char *dir, char **pgm, char **run, char *path);
 357 extern  Doname          find_suffix_rule(Name target, Name target_body, Name target_suffix, Property *command, Boolean rechecking);
 358 extern  Chain           find_target_groups(register Name_vector target_list, register int i, Boolean reset);
 359 extern  void            finish_children(Boolean docheck);
 360 extern  void            finish_running(void);
 361 extern  void            free_chain(Name_vector ptr);
 362 extern  void            gather_recursive_deps(void);
 363 extern  char            *get_current_path(void);
 364 extern  int             get_job_msg_id(void);
 365 extern  FILE            *get_mtool_msgs_fp(void);











 366 extern  wchar_t         *getmem_wc(register int size);
 367 /* On linux getwd(char *) is defined in 'unistd.h' */
 368 #ifdef __cplusplus
 369 extern "C" {
 370 #endif
 371 extern  char            *getwd(char *);
 372 #ifdef __cplusplus
 373 }
 374 #endif
 375 extern  void            handle_interrupt(int);
 376 extern  Boolean         is_running(Name target);
 377 extern  void            load_cached_names(void);
 378 extern  Boolean         parallel_ok(Name target, Boolean line_prop_must_exists);
 379 extern  void            print_dependencies(register Name target, register Property line);
 380 extern  void            send_job_start_msg(Property line);
 381 extern  void            send_rsrc_info_msg(int max_jobs, char *hostname, char *username);
 382 extern  void            print_value(register Name value, Daemon daemon);
 383 extern  timestruc_t&        read_archive(register Name target);
 384 extern  int             read_dir(Name dir, wchar_t *pattern, Property line, wchar_t *library);
 385 extern  void            read_directory_of_file(register Name file);
 386 extern  int             read_make_machines(Name make_machines_name);
 387 extern  Boolean         read_simple_file(register Name makefile_name, register Boolean chase_path, register Boolean doname_it, Boolean complain, Boolean must_exist, Boolean report_file, Boolean lock_makefile);
 388 extern  void            remove_recursive_dep(Name target);
 389 extern  void            report_recursive_dep(Name target, char *line);
 390 extern  void            report_recursive_done(void);
 391 extern  void            report_recursive_init(void);
 392 extern  Recursive_make  find_recursive_target(Name target);
 393 extern  void            reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
 394 extern  void            set_locals(register Name target, register Property old_locals);
 395 extern  void            setvar_append(register Name name, register Name value);



 396 extern  void            setvar_envvar(void);

 397 extern  void            special_reader(Name target, register Name_vector depes, Cmd_line command);
 398 extern  void            startup_rxm();
 399 extern  Doname          target_can_be_built(register Name target);
 400 extern  char            *time_to_string(const timestruc_t &time);
 401 extern  void            update_target(Property line, Doname result);
 402 extern  void            warning(char *, ...);
 403 extern  void            write_state_file(int report_recursive, Boolean exiting);
 404 extern  Name            vpath_translation(register Name cmd);
 405 
 406 #define DEPINFO_FMT_VERSION "VERS2$"
 407 #define VER_LEN strlen(DEPINFO_FMT_VERSION)
 408 
 409 
 410 #endif