Makefile 1020 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ifdef OS
  2. CHECK_QT = cmd <<< "qtenv2.bat && vcvars64.bat && exit || exit 1"
  3. PLATFORM_QMAKE = cmd <<< "pushd %cd% && qtenv2.bat && vcvars64.bat && popd && qmake ..\qtbinding\qtbinding_windows.pro && exit || exit 1"
  4. PLATFORM_MAKE = cmd <<< "vcvars64.bat && nmake && exit || exit 1"
  5. LIBNAME = standalone/qt/build/release/qtbinding.dll
  6. EXENAME = kumachan.exe
  7. else
  8. CHECK_QT = qmake -v
  9. PLATFORM_QMAKE = qmake ../qtbinding/qtbinding.pro
  10. PLATFORM_MAKE = $(MAKE)
  11. LIBNAME = standalone/qt/build/libqtbinding*
  12. EXENAME = kumachan
  13. endif
  14. default: all
  15. check:
  16. @echo -e '\033[1mChecking for Qt...\033[0m'
  17. $(CHECK_QT)
  18. @echo -e '\033[1mChecking for Go...\033[0m'
  19. go version
  20. qt:
  21. @echo -e '\033[1mCompiling CGO Qt Binding...\033[0m'
  22. cd standalone/qt/build && $(PLATFORM_QMAKE) && $(PLATFORM_MAKE)
  23. cp -P $(LIBNAME) build/
  24. deps: check qt
  25. $(NOOP)
  26. interpreter: deps
  27. @echo -e '\033[1mCompiling the Interpreter...\033[0m'
  28. go build -o ./build/$(EXENAME) main.go
  29. .PHONY: check qt resources deps interpreter
  30. all: interpreter