Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. VERSION ?= 0.0.0
  2. .PHONY: all
  3. all: debug
  4. .PHONY: debug
  5. debug: deps/dist set-version
  6. xcodebuild -workspace ShadowsocksX-NG.xcworkspace -scheme ShadowsocksX-NG -configuration Debug SYMROOT=$${PWD}/build
  7. .PHONY: release
  8. release: deps/dist set-version
  9. xcodebuild -workspace ShadowsocksX-NG.xcworkspace -scheme ShadowsocksX-NG -configuration Release SYMROOT=$${PWD}/build
  10. .PHONY: debug-dmg release-dmg
  11. debug-dmg release-dmg: TARGET = $(subst -dmg,,$@)
  12. debug-dmg release-dmg:
  13. t="$(TARGET)" && t="`tr '[:lower:]' '[:upper:]' <<< $${t:0:1}`$${t:1}" \
  14. && rm -rf build/$${t}/ShadowsocksX-NG/ \
  15. && mkdir build/$${t}/ShadowsocksX-NG \
  16. && cp -r build/$${t}/ShadowsocksX-NG.app build/$${t}/ShadowsocksX-NG/ \
  17. && ln -s /Applications build/$${t}/ShadowsocksX-NG/Applications \
  18. && hdiutil create build/$${t}/ShadowsocksX-NG.dmg -ov -volname "ShadowsocksX-NG" -fs HFS+ -srcfolder build/$${t}/ShadowsocksX-NG/ \
  19. && rm -rf build/$${t}/ShadowsocksX-NG/
  20. .PHONY: set-version
  21. set-version:
  22. agvtool new-marketing-version $(VERSION)
  23. deps/dist:
  24. $(MAKE) -C deps
  25. .PHONY: clean
  26. clean:
  27. $(MAKE) -C deps clean