Skip to content

Add Make-compatible depfile generation (Fixes/Supersedes #41)#64

Open
ijatinydv wants to merge 1 commit intoaradi:mainfrom
ijatinydv:feat/make-depfile-support
Open

Add Make-compatible depfile generation (Fixes/Supersedes #41)#64
ijatinydv wants to merge 1 commit intoaradi:mainfrom
ijatinydv:feat/make-depfile-support

Conversation

@ijatinydv
Copy link

This PR revives and finishes up the depfile generation work originally started in #41.

I built on the original implementation with two main tweaks to make it robust for programmatic use:

  1. Integrated execution: process_file() now automatically handles writing the depfile if the --depfile option is passed, mirroring standard compiler behavior (like GCC's -MMD).
  2. Stateless dependency tracking: Fixed a bug where reusing a Parser or Fypp instance across multiple files would leak stale dependencies from previous runs into the new depfile.

Also added a few tests to verify the Make-escaping logic (spaces, #, $). Let me know if anything needs tweaking!

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.

1 participant