# # Configuration for kicad build & install # # Locations for install targets. All can be overriden on the make command. # Normally you'd only expect to override the PREFIX if you want to install to # a non standard install dir (or a temp location for packaging). # For packaging you can override and install anywhere, but to run from a # non-standard location edit common/gestfich.ccp so it knows where to # load help/data/etc. files from. # Current supported PREFIXes are /usr, /usr/local & /usr/local/kicad STD_INSTALL = 1 ifeq ($(STD_INSTALL), 1) PREFIX = /usr KICAD_BIN = $(PREFIX)/bin KICAD_PLUGINS = $(PREFIX)/lib/kicad/plugins KICAD_DOCS=$(PREFIX)/share/doc/kicad KICAD_DATA=$(PREFIX)/share/kicad KICAD_MODULES=$(KICAD_DATA)/modules KICAD_LIBRARY=$(KICAD_DATA)/library KICAD_INTERNAT=$(KICAD_DATA)/internat KICAD_TEMPLATE=$(KICAD_DATA)/template else # used by myself (JP Charras) to build a statically linked distribution intalled in /usr/local (with STD_INSTALL = 0) PREFIX = /usr/local/linux KICAD_BIN = $(PREFIX)/bin KICAD_PLUGINS = $(PREFIX)/linux/plugins KICAD_DOCS=$(PREFIX)/help KICAD_DATA=$(PREFIX) KICAD_MODULES=$(KICAD_DATA)/modules KICAD_LIBRARY=$(KICAD_DATA)/library KICAD_INTERNAT=$(KICAD_DATA)/internat KICAD_TEMPLATE=$(KICAD_DATA)/template endif # http://www.gnu.org/software/autoconf/manual/make/Catalogue-of-Rules.html#Catalogue-of-Rules CXX = g++ SRCSUFF = .cpp OBJSUFF = .o FINAL = 1 # turn on/OFF debugging for all executables, only tested without KICAD_PYTHON DEBUG = 0 # common CPPFLAGS to all components, further CPPFLAGS customization in # directory specific makefile.gtk files. ifeq ($(DEBUG), 1) WXXFLAGS := $(shell wx-config --debug --cxxflags) CPPFLAGS = -Wall -g3 -ggdb3 ${WXXFLAGS} -fno-strict-aliasing -DDEBUG LDFLAGS = -g3 -ggdb3 #-v else WXXFLAGS := $(shell wx-config --cxxflags) CPPFLAGS = -Wall -O2 ${WXXFLAGS} -fno-strict-aliasing LDFLAGS = -s #-v endif # a command line define which affects pcbnew only, causing it to match current layer ifdef USE_MATCH_LAYER CPPFLAGS += -DUSE_MATCH_LAYER endif # You must comment or uncomment this line to disable/enable python support #KICAD_PYTHON = 1 # You must uncomment these lines for static link (or build with "make -f makefile.gtk KICAD_STATIC_LINK=1") # dynamic link is less difficult than static link and is what you would normally want # to use if kicad is running only on your system or one with same level of libraries. ifndef KICAD_PYTHON ifeq ($(STD_INSTALL), 0) KICAD_STATIC_LINK = 1 endif endif ifeq ($(KICAD_STATIC_LINK), 1) LD = gcc else LD = g++ endif ifdef KICAD_PYTHON PYTHON_VERSION=2.5 PYLIBS= -L/usr/lib PYLIBS+= -L /usr/include/python PYLIBS+= -lpython$(PYTHON_VERSION) PYLIBS+= -lboost_python EXTRACPPFLAGS+=-I /usr/include/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing endif # path and version definition for wxWidgets and mesa libs MESALIBSPATH = /usr/local/lib WXPATH = `wx-config --prefix`/lib PREFIX_WX_LIBS = lib`wx-config --basename` SUFFIX_WX_LIBSTD = `wx-config --utility=` SUFFIX_WX_LIBGL = _gl-$(LIBVERSION).a # Use static link for libstdc++.a (sometimes also libsupc++.a) # locate libstdc++.a and copy it in kicad_dev/syslibs ifeq ($(KICAD_STATIC_LINK), 1) #define path for a copy of libstdc++.a or/and libsupc++.a: LIBSTDC = ../syslibs/libstdc++.a else # Or Use static link for libsupc++ or libstdc++ (more easy!!) LIBSTDC = #-lstdc++ is implied when using g++ to link endif LIBVERSION=`wx-config --release` LIBREGEX=$(WXPATH)/libwxregexu-$(LIBVERSION).a # use link static for wxWidgets ifeq ($(KICAD_STATIC_LINK), 1) LIBS3D = $(WXPATH)/$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL)\ $(MESALIBSPATH)/libGL.a $(MESALIBSPATH)/libGLU.a WXSYSLIB= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \ $(WXPATH)/libwxpng-$(LIBVERSION).a\ $(WXPATH)/libwxjpeg-$(LIBVERSION).a\ $(WXPATH)/libwxzlib-$(LIBVERSION).a\ $(LIBREGEX)\ /usr/X11R6/lib/libXinerama.a \ -lgtk-x11-2.0 -lgdk-x11-2.0 \ -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lgthread-2.0\ -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl\ -lglib-2.0 -lpangoft2-1.0 -lSM\ -L/usr/lib $(PYLIBS) WXSYSLIB_WITH_GL= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \ $(WXPATH)/libwxpng-$(LIBVERSION).a\ $(WXPATH)/libwxjpeg-$(LIBVERSION).a\ $(WXPATH)/libwxzlib-$(LIBVERSION).a\ $(LIBS3D)\ /usr/X11R6/lib/libXinerama.a \ /usr/X11R6/lib/libXxf86vm.a \ -lgtk-x11-2.0 -lgdk-x11-2.0 \ -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lgthread-2.0\ -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl\ -lglib-2.0 -lpangoft2-1.0 -lSM\ -L/usr/lib $(PYLIBS) else ifeq ($(DEBUG), 1) # debug wxWidgets WXSYSLIB= `wx-config --debug --libs std` WXSYSLIB_WITH_GL= `wx-config --debug --libs std,gl` else # or use "standard command" for wxWidgets WXSYSLIB= `wx-config --libs std` WXSYSLIB_WITH_GL= `wx-config --libs std,gl` endif endif # attention à l'ordre des libairies LIBS = -L/usr/local/lib -L/usr/X11R6/lib\ $(EXTRALIBS) $(WXSYSLIB)\ $(LIBSTDC) $(PYLIBS) LIBS_WITH_GL = -L/usr/local/lib -L/usr/X11R6/lib\ $(EXTRALIBS) $(WXSYSLIB_WITH_GL)\ $(LIBSTDC) $(PYLIBS)