Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ifdef OS
  2. MSVC_CHECK = cl /?
  3. PLATFORM_MAKE = cmd <<< "vcvars64.bat && nmake && exit || exit 1"
  4. LIB_PROJECT = qtbinding_windows.pro
  5. LIB_BIN = standalone/qt/build/release/qtbinding.dll
  6. EXENAME = kumachan.exe
  7. else
  8. MSVC_CHECK = $(NOOP)
  9. PLATFORM_MAKE = $(MAKE)
  10. LIB_PROJECT = qtbinding.pro
  11. LIB_BIN = standalone/qt/build/libqtbinding*
  12. EXENAME = kumachan
  13. endif
  14. default: all
  15. check:
  16. @echo -e '\033[1mChecking for Qt...\033[0m'
  17. qmake -v
  18. $(MSVC_CHECK)
  19. @echo -e '\033[1mChecking for Go...\033[0m'
  20. go version
  21. qt:
  22. @echo -e '\033[1mCompiling CGO Qt Binding...\033[0m'
  23. cd standalone/qt/build && qmake ../qtbinding/$(LIB_PROJECT) && $(PLATFORM_MAKE)
  24. cp -P $(LIB_BIN) build/
  25. stdlib:
  26. @echo -e '\033[1mCopying Standard Library Files...\033[0m'
  27. if [ -d build/stdlib ]; then rm -r build/stdlib; fi
  28. cp -rP stdlib build/
  29. rm build/stdlib/*.go
  30. deps: check qt stdlib
  31. $(NOOP)
  32. interpreter: deps
  33. @echo -e '\033[1mCompiling the Interpreter...\033[0m'
  34. go build -o ./build/$(EXENAME) main.go
  35. .PHONY: check qt stdlib resources deps interpreter
  36. all: interpreter