timbertson / gup

A better make, inspired by djb's redo.
GNU Lesser General Public License v2.1
51 stars 5 forks source link

Output filenames make it hard to write build-scripts for certain compilers #11

Closed gkleen closed 8 years ago

gkleen commented 8 years ago

Some compilers (notably pandoc) rely on the extension of the target-filename to determine behaviour.

Taken from pandocs manpage:

To produce a PDF, specify an output file with a .pdf extension. […]

pandoc test.txt -o test.pdf

I propose either:

I have basic knowledge of python and would be willing to contribute patches if needed.

timbertson commented 8 years ago

Great point, I hadn't thought of that. The only trouble I can see is we'd need to also change the other suffixes to prefixes - so that you couldn't get some weird case where you have an outfile for foo.lock called out.foo.lock and a lockfile for out.foo called out.foo.lock. It's an edge case, but it's probably best to be consistent anyway.

And in fact, changing them all at once makes it pretty simple. Here's a branch, I'll merge once I've had a chance to do some proper testing: https://github.com/timbertson/gup/pull/12