Skip to content

Conversation

@adi-g15
Copy link

@adi-g15 adi-g15 commented Jan 28, 2022

Some makefiles may include include statements, this commit includes support for it.

I originally searched for makefile parsers to find a way to visualise makefile of some OS projects.

For eg. Redox OS's makefile starts with these:

# Configuration and variables
include mk/config.mk

# Dependencies
include mk/depends.mk

all: build/harddrive.bin

coreboot: build/coreboot.elf

…

Which the script caught as UNHANDLED, this is my edit I made to support it.

It works well for redox, and atleast doesn't break existing usage :)

There maybe problematic case, when say a 'include' statement doesn't have a comment as the lastToken, then we would be removing some other valid data otherwise
This commit solves that
@kba
Copy link
Owner

kba commented Jan 30, 2022

Very cool, thanks for the contribution! I am using makefile-parser more or less exclusively to have self-documenting makefiles, what are you doing with the parsing results?

@adi-g15
Copy link
Author

adi-g15 commented Jan 30, 2022

Very cool, thanks for the contribution! I am using makefile-parser more or less exclusively to have self-documenting makefiles, what are you doing with the parsing results?

Thanks, i actually just wanted to visualise Makefile of starter OSs, a temporary quick look at what components it builds etc, nothing after that, so just searched Makefile parser, found yours, would have used graphviz to get a tree/graph kind of, though not doing that, your parser is enough for me :D

As for the pr, the include lines were showing as Unhandled, that was one thing I thought can 'fix', so tried it 😅

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

Successfully merging this pull request may close these issues.

2 participants