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

Fix make build_release after changes to lib_internalSwiftSyntaxParser #493

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
RELEASE_BUILD_FLAGS=-c release --disable-sandbox --arch x86_64 --arch arm64
BIN_PATH=$(shell swift build $(RELEASE_BUILD_FLAGS) --show-bin-path)/periphery
BUILD_PATH=.build
SWIFT_BUILD_FLAGS=--configuration release --disable-sandbox --build-path ${BUILD_PATH}

build_release:
@swift build $(RELEASE_BUILD_FLAGS)
@install_name_tool -add_rpath @loader_path ${BIN_PATH}
EXECUTABLE_X86_64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery
EXECUTABLE_ARM64=$(shell swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery
EXECUTABLE=${BUILD_PATH}/periphery

clean:
@swift package clean

build_x86_64:
@swift build ${SWIFT_BUILD_FLAGS} --arch x86_64

build_arm64:
@swift build ${SWIFT_BUILD_FLAGS} --arch arm64

build_release: clean build_x86_64 build_arm64
@lipo -create -output ${EXECUTABLE} ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64}
@strip -rSTX ${EXECUTABLE}

show_bin_path:
@echo ${BIN_PATH}
@echo ${EXECUTABLE}
Comment on lines 21 to +22
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's probably worth confirming the exact purpose of make show_bin_path now, since we have to manually create the universal binary, the output path (.build/periphery) is always known anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's used in the release script. Probably not quite as useful now, but still, it's nice to keep the logic in here.