DISTRHO Plugin Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9KB

  1. #!/usr/bin/make -f
  2. # Makefile for dgl #
  3. # ---------------- #
  4. # Created by falkTX
  5. #
  6. AR ?= ar
  7. RM ?= rm -f
  8. CC ?= gcc
  9. CXX ?= g++
  10. # --------------------------------------------------------------
  11. # Fallback to Linux if no other OS defined
  12. ifneq ($(MACOS),true)
  13. ifneq ($(WIN32),true)
  14. LINUX=true
  15. endif
  16. endif
  17. # --------------------------------------------------------------
  18. # Common build and link flags
  19. BASE_FLAGS = -Wall -Wextra -fPIC -DPIC -pipe -DREAL_BUILD
  20. BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse
  21. ifeq ($(RASPPI),true)
  22. # Raspberry-Pi optimization flags
  23. BASE_OPTS = -O3 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
  24. endif
  25. ifeq ($(DEBUG),true)
  26. BASE_FLAGS += -DDEBUG -O0 -g
  27. else
  28. BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
  29. CXXFLAGS += -fvisibility-inlines-hidden
  30. LINK_OPTS += -Wl,--strip-all
  31. endif
  32. BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
  33. BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS)
  34. LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS)
  35. ifeq ($(MACOS),true)
  36. # Get rid of most options for old gcc4.2
  37. BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS)
  38. LINK_FLAGS = $(LDFLAGS)
  39. endif
  40. # --------------------------------------------------------------
  41. # Check for required libs
  42. ifeq ($(LINUX),true)
  43. ifneq ($(shell pkg-config --exists gl && echo true),true)
  44. $(error OpenGL missing, cannot continue)
  45. endif
  46. ifneq ($(shell pkg-config --exists x11 && echo true),true)
  47. $(error X11 missing, cannot continue)
  48. endif
  49. endif
  50. # --------------------------------------------------------------
  51. # Set libs stuff
  52. ifeq ($(LINUX),true)
  53. DGL_FLAGS = $(shell pkg-config --cflags gl x11)
  54. DGL_LIBS = $(shell pkg-config --libs gl x11)
  55. endif
  56. ifeq ($(MACOS),true)
  57. DGL_LIBS = -framework OpenGL -framework Cocoa
  58. endif
  59. ifeq ($(WIN32),true)
  60. DGL_LIBS = -lopengl32 -lgdi32
  61. endif
  62. # --------------------------------------------------------------