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.

139 lines
4.2 KiB

  1. #
  2. # Configuration for kicad build & install
  3. #
  4. # Locations for install targets. All can be overriden on the make command.
  5. # Normally you'd only expect to override the PREFIX if you want to install to
  6. # a non standard install dir (or a temp location for packaging).
  7. # For packaging you can override and install anywhere, but to run from a
  8. # non-standard location edit common/gestfich.ccp so it knows where to
  9. # load help/data/etc. files from.
  10. # Current supported PREFIXes are /usr, /usr/local & /usr/local/kicad
  11. PREFIX = /usr
  12. KICAD_BIN = $(PREFIX)/bin
  13. KICAD_PLUGINS = $(PREFIX)/lib/kicad/plugins
  14. KICAD_DOCS=$(PREFIX)/share/doc/kicad
  15. KICAD_DATA=$(PREFIX)/share/kicad
  16. KICAD_MODULES=$(KICAD_DATA)/modules
  17. KICAD_LIBRARY=$(KICAD_DATA)/library
  18. KICAD_INTERNAT=$(KICAD_DATA)/internat
  19. KICAD_TEMPLATE=$(KICAD_DATA)/template
  20. # http://www.gnu.org/software/autoconf/manual/make/Catalogue-of-Rules.html#Catalogue-of-Rules
  21. CXX = g++
  22. LD = g++
  23. SRCSUFF = .cpp
  24. OBJSUFF = .o
  25. FINAL = 1
  26. # turn on debugging for all executables, only tested without KICAD_PYTHON
  27. DEBUG = 1
  28. # common CPPFLAGS to all components, further CPPFLAGS customization in
  29. # directory specific makefile.gtk files.
  30. ifeq ($(DEBUG), 1)
  31. CPPFLAGS = -Wall -g `wx-config --debug --cxxflags` -fno-strict-aliasing
  32. LDFLAGS = -g #-v
  33. else
  34. CPPFLAGS = -Wall -O2 `wx-config --cxxflags` -fno-strict-aliasing
  35. LDFLAGS = -s #-v
  36. endif
  37. # You must comment or uncomment this line to disable/enable python support
  38. #KICAD_PYTHON = 1
  39. # You must uncomment these lines for static link (or build with "make -f makefile.gtk KICAD_STATIC_LINK=1")
  40. # dynamic link is less difficult than static link and is what you would normally want
  41. # to use if kicad is running only on your system or one with same level of libraries.
  42. #ifndef KICAD_PYTHON
  43. #KICAD_STATIC_LINK = 1
  44. #endif
  45. ifdef KICAD_PYTHON
  46. PYTHON_VERSION=2.5
  47. PYLIBS= -L/usr/lib
  48. PYLIBS+= -L /usr/include/python
  49. PYLIBS+= -lpython$(PYTHON_VERSION)
  50. PYLIBS+= -lboost_python
  51. EXTRACPPFLAGS+=-I /usr/include/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing
  52. endif
  53. # path and version definition for wxWidgets and mesa libs
  54. MESALIBSPATH = /usr/local/lib
  55. WXPATH = `wx-config --prefix`/lib
  56. PREFIX_WX_LIBS = lib`wx-config --basename`
  57. SUFFIX_WX_LIBSTD = `wx-config --utility=`
  58. SUFFIX_WX_LIBGL = _gl-$(LIBVERSION).a
  59. # Use static link for libstdc++.a (sometimes also libsupc++.a)
  60. # locate libstdc++.a and copy it in kicad_dev/syslibs
  61. ifeq ($(KICAD_STATIC_LINK), 1)
  62. #define path for a copy of libstdc++.a or/and libsupc++.a:
  63. LIBSTDC = ../syslibs/libstdc++.a
  64. else
  65. # Or Use static link for libsupc++ or libstdc++ (more easy!!)
  66. LIBSTDC = -lstdc++
  67. endif
  68. LIBVERSION=`wx-config --release`
  69. LIBREGEX=$(WXPATH)/libwxregexu-$(LIBVERSION).a
  70. # use link static for wxWidgets
  71. ifeq ($(KICAD_STATIC_LINK), 1)
  72. LIBS3D = $(WXPATH)/$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL)\
  73. $(MESALIBSPATH)/libGL.a $(MESALIBSPATH)/libGLU.a
  74. WXSYSLIB= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \
  75. $(WXPATH)/libwxpng-$(LIBVERSION).a\
  76. $(WXPATH)/libwxjpeg-$(LIBVERSION).a\
  77. $(WXPATH)/libwxzlib-$(LIBVERSION).a\
  78. $(LIBREGEX)\
  79. /usr/X11R6/lib/libXinerama.a \
  80. -lgtk-x11-2.0 -lgdk-x11-2.0 \
  81. -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lgthread-2.0\
  82. -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl\
  83. -lglib-2.0 -lpangoft2-1.0 -lSM\
  84. -L/usr/lib $(PYLIBS)
  85. WXSYSLIB_WITH_GL= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \
  86. $(WXPATH)/libwxpng-$(LIBVERSION).a\
  87. $(WXPATH)/libwxjpeg-$(LIBVERSION).a\
  88. $(WXPATH)/libwxzlib-$(LIBVERSION).a\
  89. $(LIBS3D)\
  90. /usr/X11R6/lib/libXinerama.a \
  91. /usr/X11R6/lib/libXxf86vm.a \
  92. -lgtk-x11-2.0 -lgdk-x11-2.0 \
  93. -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lgthread-2.0\
  94. -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl\
  95. -lglib-2.0 -lpangoft2-1.0 -lSM\
  96. -L/usr/lib $(PYLIBS)
  97. else
  98. ifeq ($(DEBUG), 1)
  99. # debug wxWidgets
  100. WXSYSLIB= `wx-config --debug --libs std`
  101. WXSYSLIB_WITH_GL= `wx-config --debug --libs std,gl`
  102. else
  103. # or use "standard command" for wxWidgets
  104. WXSYSLIB= `wx-config --libs std`
  105. WXSYSLIB_WITH_GL= `wx-config --libs std,gl`
  106. endif
  107. endif
  108. # attention � l'ordre des libairies
  109. LIBS = -L/usr/local/lib -L/usr/X11R6/lib\
  110. $(EXTRALIBS) $(WXSYSLIB)\
  111. $(LIBSTDC) $(PYLIBS)
  112. LIBS_WITH_GL = -L/usr/local/lib -L/usr/X11R6/lib\
  113. $(EXTRALIBS) $(WXSYSLIB_WITH_GL)\
  114. $(LIBSTDC) $(PYLIBS)