The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

build

  my $handle = build($objinfo);

Starts building the specified object. When build() returns, the object may not have been built yet; build() returns a handle (see MakeEvent.pm for details) which you can wait on if you want to wait until the build is actually done. The usual idiom is

  wait_for main::build($objinfo);

If you do this, of course, you make it harder for makepp to build targets in parallel because the makepp process will not spawn any other build requests until this one is done.

When any targets are built, the global variable $n_files_changed is updated.

find_backward_inference_rule

  $rule = find_backward_inference_rule($target_info);

This procedure is called whenever we need to build a target and no rule is currently known. Eventually, it will try to prodce a backward inference rule. Currently, it does nothing.

find_makepp_info

  $minfo = find_makepp_info("name"[, $default_dir]);

Returns the object information for the particular object. If the object is a file, this subroutine just calls FileInfo::file_info. If it is a user defined object, then it invokes the registered findinfo routine for that object type.

find_makepp_info_regster

  find_makepp_info_register(\&find_makepp_info_routine);

Registers a new routine that can return makepp information structures for some object class.

parse_command_line

  parse_command_line(@ARGV, \%environment_hash);

Parses and executes the given command line. Loads whatever makefiles are necessary and builds the appropriate targets, or at least starts off the build. (It doesn't wait until the build is finished.) Returns a list of build handles.

The environment must be provided as a reference to a hash. Any rules which are executed have the environment set to this value before the shell is invoked.

This parser only accepts options which are valid during recursive makes or from the load_makefile command. There are other options which are handled by the mainline makepp code which are not accepted here.

parse_command_line assumes that the current directory is the proper directory for executing the command.

  print_log "string";

Send the given string to the log file, if there is one. The string should not have a newline as a terminator.

To avoid the overhead of formatting a message and calling this subroutine, you can check the global variable $log_level, which is true if we are supposed to be printing to the log file.

  print_error "message";

Prints an error message, with the program name prefixed.