GNUmakefile 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ifeq ($(platform),windows)
  2. ifeq ($(hiro),)
  3. hiro := windows
  4. endif
  5. ifeq ($(hiro),windows)
  6. hiro.flags = $(flags.cpp) -DHIRO_WINDOWS
  7. hiro.options = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lole32 -lcomctl32 -lcomdlg32 -luxtheme -lmsimg32 -lshlwapi -ldwmapi
  8. endif
  9. ifeq ($(hiro),gtk2)
  10. hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0) -Wno-deprecated-declarations
  11. hiro.options = $(shell pkg-config --libs gtk+-2.0)
  12. endif
  13. ifeq ($(hiro),gtk3)
  14. hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0) -Wno-deprecated-declarations
  15. hiro.options = $(shell pkg-config --libs gtk+-3.0)
  16. endif
  17. endif
  18. ifeq ($(platform),macos)
  19. ifeq ($(hiro),)
  20. hiro := cocoa
  21. endif
  22. ifeq ($(hiro),cocoa)
  23. hiro.flags = $(flags.objcpp) -w -DHIRO_COCOA
  24. hiro.options = -framework Cocoa -framework Carbon -framework IOKit -framework Security
  25. endif
  26. endif
  27. ifneq ($(filter $(platform),linux bsd),)
  28. ifeq ($(hiro),)
  29. hiro := gtk2
  30. endif
  31. ifeq ($(hiro),gtk2)
  32. hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0) -Wno-deprecated-declarations
  33. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-2.0)
  34. endif
  35. ifeq ($(hiro),gtk2-se)
  36. flags += -DHiro_SourceEdit
  37. hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0) -Wno-deprecated-declarations
  38. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0)
  39. endif
  40. ifeq ($(hiro),gtk3)
  41. hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0) -Wno-deprecated-declarations
  42. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-3.0)
  43. endif
  44. ifeq ($(hiro),gtk3-se)
  45. flags += -DHiro_SourceEdit
  46. hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) -Wno-deprecated-declarations
  47. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0)
  48. endif
  49. ifeq ($(hiro),qt4)
  50. moc = /usr/local/lib/qt4/bin/moc
  51. hiro.flags = $(flags.cpp) -DHIRO_QT=4 $(shell pkg-config --cflags QtCore QtGui)
  52. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs QtCore QtGui)
  53. endif
  54. ifeq ($(hiro),qt5)
  55. moc = $(shell pkg-config --variable=host_bins Qt5Core)/moc
  56. hiro.flags = $(flags.cpp) -DHIRO_QT=5 -fPIC $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)
  57. hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
  58. endif
  59. endif
  60. ifeq ($(hiro.resource),)
  61. hiro.resource := $(hiro.path)/windows/hiro.rc
  62. endif
  63. hiro.objects := \
  64. $(object.path)/hiro-$(hiro).o \
  65. $(if $(filter windows,$(hiro)),$(object.path)/hiro-resource.o)
  66. $(object.path)/hiro-$(hiro).o: $(hiro.path)/hiro.cpp
  67. $(if $(filter qt%,$(hiro)),$(info Compiling $(hiro.path)/qt/qt.moc ...))
  68. $(if $(filter qt%,$(hiro)),@$(moc) -i -o $(hiro.path)/qt/qt.moc $(hiro.path)/qt/qt.hpp)
  69. $(info Compiling $(subst ../,,$<) ...)
  70. @$(compiler) $(hiro.flags) $(flags) $(flags.deps) -c $< -o $@
  71. $(object.path)/hiro-resource.o: $(hiro.resource)
  72. $(info Compiling $(subst ../,,$<) ...)
  73. @$(windres) $< $@
  74. hiro.verbose:
  75. $(info hiro Target:)
  76. $(info $([space]) $(hiro))