Skip to content

refactor: simplify Makefile by extracting repeated patterns#8549

Open
myleshorton wants to merge 1 commit intomainfrom
refactor/makefile-cleanup
Open

refactor: simplify Makefile by extracting repeated patterns#8549
myleshorton wants to merge 1 commit intomainfrom
refactor/makefile-cleanup

Conversation

@myleshorton
Copy link
Contributor

Summary

  • Extract BUILD_TYPE_SUFFIX variable for installer filename suffix (was duplicated 6 times)
  • Extract GOMOBILE_ENV for the GOMOBILECACHE/GOTOOLCHAIN env prefix (was duplicated 5 times)
  • Extract NFPM_ENV for common Linux packaging env vars (was duplicated 3 times)
  • Remove require-gomobile target (copy-paste bug: it checked for sentry-cli, not gomobile, and was never referenced)
  • Remove notarize-log target (broken syntax on line 239, hardcoded UUID, dead code)
  • Remove duplicate ios target declaration (was defined twice, lines 503 and 505)
  • Inline GOOS/GOARCH in windows-amd64/windows-arm64 (remove unnecessary target-specific vars)
  • Fix .PHONY for delete-data (was PHONY: — missing the dot)

Net: -11 lines, no behavioral changes.

Test plan

  • Verify make android-release-ci still works in CI
  • Verify make linux-release-ci packages deb/rpm/archlinux correctly
  • Verify make macos-release builds and signs correctly
  • Verify make windows-release builds correctly

🤖 Generated with Claude Code

- Extract BUILD_TYPE_SUFFIX for installer filename suffix (was repeated 6x)
- Extract GOMOBILE_ENV for gomobile env prefix (was repeated 5x)
- Extract NFPM_ENV for Linux packaging env vars (was repeated 3x)
- Remove require-gomobile (copy-paste bug: checked sentry, never used)
- Remove notarize-log (broken syntax, hardcoded UUID, dead code)
- Remove duplicate ios target declaration
- Inline GOOS/GOARCH in windows-amd64/arm64 targets
- Fix .PHONY for delete-data (was missing the dot)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 19, 2026 17:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the project’s top-level Makefile to reduce duplication by extracting repeated filename/env patterns into variables and removing dead/buggy targets.

Changes:

  • Introduces BUILD_TYPE_SUFFIX, GOMOBILE_ENV, and NFPM_ENV to centralize repeated Makefile fragments.
  • Removes unused/broken targets (require-gomobile, notarize-log) and eliminates a duplicate ios target declaration.
  • Cleans up a few targets by inlining GOOS/GOARCH for Windows and fixing .PHONY for delete-data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

./lantern-core/utils

# Common env prefix for gomobile commands
GOMOBILE_ENV = GOMOBILECACHE="$(GOMOBILECACHE)" GOTOOLCHAIN=$(GO_VERSION)


.PHONY: notarize-log
notarize-log:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to keep this. This is helpful when Noterize fails; we can easily check what the problem is.

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.

3 participants