NAME
App::HashMake - Perform make-like actions based on target file's MD5 hash value
VERSION
Version 0.01
SYNOPSIS
This module executes the logic of hashmake, based on the input arguments. Hashmake operates just like make(1), except it looks at the MD5 hash value of a target file, using a hidden file (.hash_index) to store and check these hash values for each target. If the hash value of a file has changed, the action is executed.
Instead of Makefile, hashmake looks for Hash.Makefile to decide what to do. An alternative makefile can be provided using the -f argument.
The hash values are stored in a hidden file called .hash_index, located in the same directory as the makefile. The caller can also provide an alternate working directory if the target directory's not writable.
A sample Hash.Makefile could look like this:
foo.txt
echo "I found foo!"
When hashmake is run for the first time, no MD5 is known for this file, so the action is completed, and the MD5 hash value for the file is stored. Running the same command a moment later will do nothing, since the MD5 of the file hasn't changed.
Here's an example of how it would be called from the command line.
$ hashmake
(Hashmake does it's thing with the default build file Hash.Makefile)
$ hashmake -d
(Hashmake dumps all of the current settings.)
$
The variable $@ in a Hash.Makefile line will be replaced with the target. So the Hash.Makefile line
foo.txt bar.txt
echo "Found $@"
should produce output like this:
echo foo.txt
echo bar.txt
If both of the files had no MD5s or different MD5s.
ARGUMENTS
-B Force rebuild / ignores the 'has it changed' element and just rebuild
everything.
-d Debug / This outputs useful information about what steps are being
taken during processing.
-f FILE
Specify the hash makefile if the standard Hash.Makefile is not being
used. The environment variable HASH_MAKEFILE can also be used for
this.
-h Display information on the command line arguments.
-n Print only / This just prints out what commands would have been run.
-s Silent / Don't output anything that would normally be output. Error
messages are still output.
-t Touch only / Mark all targets as being the latest.
-v Display version information.
-y DIR
Specify a work directory for the index file if the hash makefile's
directory is not writable.
SUBROUTINES/METHODS
run
Run the make procedure. Returns the exit status, along with the output from STDOUT and STDERR. Called from the hashmake executable.
dbg
Internal routine: Debug messages are output when the verbosity level is 2.
msg
Internal routine: Regular messages are output when the verbosity level is 1.
err
Internal routine: Error messages always get output.
AUTHOR
T. Alex Beamish <talexb@gmail.com>
BUGS
Please report any bugs or feature requests to bug-app-hashmake at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-HashMake. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc App::HashMake
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
GitHub issue tracker
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by T. Alex Beamish <talexb@gmail.com>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)