make.py icon indicating copy to clipboard operation
make.py copied to clipboard

Looks great! How do I start?

Open JeffreyBenjaminBrown opened this issue 6 years ago • 2 comments

Judging from the syntax in the example, this looks wonderful. But how do I use it? Suppose I write a valid rules.py file. Is it just a matter of copying make.py to the same folder and then run python3 make.py?

Also, do I need gnu_make_parse.py? Will it be useful for translating any of my giant unreadable GNU makefiles into this syntax?

JeffreyBenjaminBrown avatar Nov 19 '19 22:11 JeffreyBenjaminBrown

Answered my first question: To use make.py, clone it, write a rules.py file anywhere, then call <path to the make.py file> <name of thing to build> from the folder containing the rules.

JeffreyBenjaminBrown avatar Nov 19 '19 23:11 JeffreyBenjaminBrown

Hey, thanks for checking it out!

Is it just a matter of copying make.py to the same folder and then run python3 make.py?

Looks like you figured this out, but for everyone else (before I actually write some documentation for this):

That's one way, but I would recommend putting this repository somewhere in your $PATH (if you're on something Unixy, not sure the equivalent for Windows). That way you can use it anywhere without copying it around all the time.

Also, the main invocation is make.py output_file.... There's no "default" or "all" rule or anything like that right now, you have to specify which outputs you need.

By default it will look for a rules.py in the current directory, or you can specify another path with -f <rules.py>.

All the outputs go in an _out directory in the current directory (which I think should be changed now that I look--it should be in the same directory as the base rules.py). (EDIT for posterity: actually this is wrong, I misread the code. Output paths are always relative to the rules.py file)

Also, do I need gnu_make_parse.py? Will it be useful for translating any of my giant unreadable GNU makefiles into this syntax? You don't need gnu_make_parse.py for normal usage, it is for converting some nontrivial-but-still-limited subset of GNU makefile syntax to a rules.py. I put some intelligence in there a little while back to try and make "sane" rules that factored out common directories, command line arguments, etc.

I was using it to convert some gigantic pile of makefiles generated by Eclipse into something reasonable (I was getting about a 10x reduction in size IIRC). I'm definitely curious to see if it can handle your makefiles, but it should probably be considered alpha/experimental. One limitation I know of is that right now it might change the order of command line arguments (though it handles flags that start with -), which sometimes matters.

zwegner avatar Nov 19 '19 23:11 zwegner