<NME> Makefile
<BEF> TOOL_NAME = xcodegen
LIB_NAME = libCYaml.dylib

INSTALL_PATH = /usr/local/bin
LIB_PATH = /usr/local/lib
SHARE_PATH = /usr/local/share/xcodegen
BUILD_PATH = .build/release
CURRENT_PATH = $(PWD)

install:
	swift build -c release -Xlinker -rpath -Xlinker @executable_path -Xswiftc -static-stdlib
	install_name_tool -change $(CURRENT_PATH)/$(BUILD_PATH)/$(LIB_NAME) $(LIB_PATH)/$(LIB_NAME) $(BUILD_PATH)/$(TOOL_NAME)
	cp -f $(BUILD_PATH)/$(TOOL_NAME) $(INSTALL_PATH)/$(TOOL_NAME)
	cp $(BUILD_PATH)/$(LIB_NAME) $(LIB_PATH)/$(LIB_NAME)
	mkdir -p $(SHARE_PATH)
	cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets
uninstall:
	rm -f $(INSTALL_PATH)/$(TOOL_NAME)
.PHONY: install build uninstall format_code brew release

install: build
	mkdir -p $(PREFIX)/bin
	cp -f $(EXECUTABLE_PATH) $(INSTALL_PATH)
	mkdir -p $(SHARE_PATH)
	cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets

build:
	swift build $(SWIFT_BUILD_FLAGS)

uninstall:
	rm -f $(INSTALL_PATH)
	rm -rf $(SHARE_PATH)

format_code:
	swiftformat .

release:
	sed -i '' 's|\(let version = Version("\)\(.*\)\(")\)|\1$(VERSION)\3|' Sources/XcodeGen/main.swift
	sed -i '' 's|\(.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "\)\(.*\)\(")\)|\1$(VERSION)\3|' README.md

	git add .
	git commit -m "Update to $(VERSION)"
	#git tag $(VERSION)

publish: archive brew
	echo "published $(VERSION)"

brew:
	brew update
	brew bump-formula-pr --url=$(RELEASE_TAR) XcodeGen

archive: build
	./scripts/archive.sh "$(EXECUTABLE_PATH)"

<MSG> remove copying of libCYaml.dylib

<DFF> @@ -1,18 +1,14 @@
 TOOL_NAME = xcodegen
-LIB_NAME = libCYaml.dylib
 
-INSTALL_PATH = /usr/local/bin
-LIB_PATH = /usr/local/lib
-SHARE_PATH = /usr/local/share/xcodegen
-BUILD_PATH = .build/release
+INSTALL_PATH = /usr/local/bin/$(TOOL_NAME)
+SHARE_PATH = /usr/local/share/$(TOOL_NAME)
+BUILD_PATH = .build/release/$(TOOL_NAME)
 CURRENT_PATH = $(PWD)
 
 install:
-	swift build -c release -Xlinker -rpath -Xlinker @executable_path -Xswiftc -static-stdlib
-	install_name_tool -change $(CURRENT_PATH)/$(BUILD_PATH)/$(LIB_NAME) $(LIB_PATH)/$(LIB_NAME) $(BUILD_PATH)/$(TOOL_NAME)
-	cp -f $(BUILD_PATH)/$(TOOL_NAME) $(INSTALL_PATH)/$(TOOL_NAME)
-	cp $(BUILD_PATH)/$(LIB_NAME) $(LIB_PATH)/$(LIB_NAME)
+	swift build -c release -Xswiftc -static-stdlib
+	cp -f $(BUILD_PATH) $(INSTALL_PATH)
 	mkdir -p $(SHARE_PATH)
 	cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets
 uninstall:
-	rm -f $(INSTALL_PATH)/$(TOOL_NAME)
+	rm -f $(INSTALL_PATH)

{'addition_count': 6, 'commit_subject': 'remove copying of libCYaml.dylib', 'deletion_count': 10, 'file_extension': '', 'lang': 'Makefile', 'license': 'mit', 'repo_name': 'yonaskolb/XcodeGen'}