Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ifdef OS
  2. QMAKE_RELEASE = release
  3. QTBINDING_DLL = standalone/qt/build/release/qtbinding.dll
  4. EXENAME = kumachan.exe
  5. DLLNAME = kumachan.dll
  6. else
  7. QMAKE_RELEASE = .
  8. QTBINDING_DLL = standalone/qt/build/libqtbinding*
  9. EXENAME = kumachan
  10. DLLNAME = kumachan.so
  11. endif
  12. ifeq ($(QTBINDING_ASAN),1)
  13. ASAN_ENABLED = 1
  14. ASAN_FLAG = -asan
  15. else
  16. ASAN_ENABLED = 0
  17. ASAN_FLAG =
  18. endif
  19. .PHONY: check qt qt-clean crash-report naive-debugger tools deps interpreter release
  20. default: interpreter
  21. check:
  22. @echo -e '\033[1mChecking for Qt...\033[0m'
  23. qmake -v
  24. @echo -e '\033[1mChecking for Go...\033[0m'
  25. go version
  26. qt:
  27. @echo -e '\033[1mCompiling CGO Qt Binding...\033[0m'
  28. cd standalone/qt/build && qmake ../qtbinding/qtbinding.pro && $(MAKE)
  29. cp -P $(QTBINDING_DLL) build/
  30. qt-clean:
  31. cd standalone/qt/build && $(MAKE) clean
  32. rm standalone/qt/build/Makefile
  33. crash-report:
  34. @echo -e '\033[1mCompiling Tool: Crash Report...\033[0m'
  35. cd support/tools/crash_report/build && qmake ../crash_report.pro && $(MAKE)
  36. cp support/tools/crash_report/build/$(QMAKE_RELEASE)/crash_report* build/
  37. naive-debugger:
  38. @echo -e '\033[1mCompiling Tool: Naive Debugger...\033[0m'
  39. cd support/tools/naive_debugger/build && qmake ../naive_debugger.pro && $(MAKE)
  40. cp support/tools/naive_debugger/build/$(QMAKE_RELEASE)/naive_debugger* build/
  41. tools: crash-report naive-debugger
  42. $(NOOP)
  43. deps: check qt tools
  44. $(NOOP)
  45. interpreter: deps
  46. @echo -e '\033[1mCompiling the Interpreter...\033[0m'
  47. go build $(ASAN_FLAG) -o build/$(EXENAME) main.go
  48. go build $(ASAN_FLAG) -buildmode=c-shared -o build/$(DLLNAME) main.lib.go
  49. chmod a+x build/$(DLLNAME)
  50. release: qt-clean interpreter
  51. ifeq ($(ASAN_ENABLED),1)
  52. @echo "*** cannot make release with ASAN enabled"
  53. exit 1
  54. endif
  55. cd build && tar -vcapf release.tar.gz `ls * | grep -v -e "go_test_\|release"`