1
0

makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. # Copyright 2011-2014 Branimir Karadzic. All rights reserved.
  3. # License: http://www.opensource.org/licenses/BSD-2-Clause
  4. #
  5. UNAME := $(shell uname)
  6. ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin SunOS FreeBSD GNU/kFreeBSD NetBSD OpenBSD GNU))
  7. ifeq ($(UNAME),$(filter $(UNAME),Darwin))
  8. OS=darwin
  9. else
  10. ifeq ($(UNAME),$(filter $(UNAME),SunOS))
  11. OS=solaris
  12. else
  13. ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
  14. OS=bsd
  15. else
  16. OS=linux
  17. endif
  18. endif
  19. endif
  20. else
  21. OS=windows
  22. endif
  23. .PHONY: release
  24. GENIE=bin/$(OS)/genie
  25. PROJECT_TYPE?=gmake
  26. SILENT?=@
  27. $(GENIE):
  28. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS)
  29. all: $(SILENT) $(GENIE)
  30. clean:
  31. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean
  32. $(SILENT) -rm -rf bin
  33. projgen:
  34. $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).windows --os=windows $(PROJECT_TYPE)
  35. $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).linux --os=linux $(PROJECT_TYPE)
  36. $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).darwin --os=macosx --platform=universal32 $(PROJECT_TYPE)
  37. $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).freebsd --os=bsd $(PROJECT_TYPE)
  38. rebuild:
  39. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all
  40. release-windows release-darwin: $(GENIE)
  41. $(GENIE) release
  42. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all
  43. $(SILENT) git checkout src/host/version.h
  44. release-linux: $(GENIE)
  45. $(SILENT) $(GENIE) release
  46. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin20.2-clang
  47. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all
  48. $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc
  49. $(SILENT) git checkout src/host/version.h
  50. release: release-$(OS)
  51. dist: release
  52. cp bin/linux/genie ../bx/tools/bin/linux/
  53. cp bin/windows/genie.exe ../bx/tools/bin/windows/
  54. cp bin/darwin/genie ../bx/tools/bin/darwin/