Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looks great! How do I start? #1

Open
JeffreyBenjaminBrown opened this issue Nov 19, 2019 · 2 comments
Open

Looks great! How do I start? #1

JeffreyBenjaminBrown opened this issue Nov 19, 2019 · 2 comments

Comments

@JeffreyBenjaminBrown
Copy link

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
Copy link
Author

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.

@zwegner
Copy link
Owner

zwegner commented Nov 19, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants