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.

174 lines
4.9 KiB

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