The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Makefile::Update - Update make files.

VERSION

version 0.4

SYNOPSIS

    use Makefile::Update;
    my $vars = read_files_list('files.lst');
    upmake('foo.vcxproj', $vars->{sources}, $vars->{headers});

FUNCTIONS

read_files_list

Reads the file containing the file lists definitions and returns a hash ref with variable names as keys and refs to arrays of the file names as values.

Takes an (open) file handle as argument.

The file contents is supposed to have the following very simple format:

    # Comments are allowed and ignored.
    #
    # The variable definitions must always be in the format shown below,
    # i.e. whitespace is significant and there should always be a single
    # file per line.
    sources =
        file1.cpp
        file2.cpp

    headers =
        file1.h
        file2.h

    # It is also possible to define variables in terms of other variables
    # defined before it in the file (no forward references):
    everything =
        $sources
        $headers

upmake

Update a file in place using the specified function and passing it the rest of the arguments.

The first parameter is either just the file path or a hash reference which may contain the following keys:

file

The path to the file to be updated, required.

verbose

If true, give more messages about what is being done.

quiet

If true, don't output any non-error messages.

dryrun

If true, don't really update the file but just output whether it would have been updated or not. If verbose is also true, also output the diff of the changes that would have been done.

This is meant to be used with update_xxx() defined in different Makefile::Update::Xxx modules.

Returns 1 if the file was changed or 0 otherwise.

AUTHOR

Vadim Zeitlin <vz-cpan@zeitlins.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Vadim Zeitlin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.