2007-06-16 09:07:23 +00:00
|
|
|
|
#
|
|
|
|
|
# Configuration for kicad build & install
|
|
|
|
|
#
|
|
|
|
|
|
2007-11-09 14:42:10 +00:00
|
|
|
|
# You must comment or uncomment this line to disable/enable python support
|
|
|
|
|
#KICAD_PYTHON = 1
|
|
|
|
|
|
2007-06-16 09:07:23 +00:00
|
|
|
|
# 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.
|
2007-11-09 14:42:10 +00:00
|
|
|
|
# Current supported PREFIXes are /usr and /usr/local (standard install for distributions)
|
|
|
|
|
# and /usr/local/kicad is used when STD_INSTALL = 0 or STD_INSTALL = 2
|
|
|
|
|
# all kicad files will be in /usr/local/kicad
|
|
|
|
|
# STD_INSTALL = 2 is used only to make static link (only useful when kicad run on an other
|
|
|
|
|
# linux distribution than the distributions used to compil kicad.
|
2007-07-02 12:48:10 +00:00
|
|
|
|
|
|
|
|
|
STD_INSTALL = 1
|
|
|
|
|
|
2007-11-09 14:42:10 +00:00
|
|
|
|
#*******************************************
|
|
|
|
|
#*******************************************
|
|
|
|
|
|
|
|
|
|
ifndef KICAD_PYTHON
|
|
|
|
|
ifeq ($(STD_INSTALL), 2)
|
|
|
|
|
KICAD_STATIC_LINK = 1
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifndef KICAD_STATIC_LINK
|
|
|
|
|
KICAD_STATIC_LINK = 0
|
|
|
|
|
endif
|
|
|
|
|
|
2007-07-02 12:48:10 +00:00
|
|
|
|
ifeq ($(STD_INSTALL), 1)
|
2007-06-16 09:07:23 +00:00
|
|
|
|
PREFIX = /usr
|
2007-07-09 19:34:54 +00:00
|
|
|
|
KICAD_BIN = $(PREFIX)/bin
|
2007-06-16 09:07:23 +00:00
|
|
|
|
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
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2007-07-02 12:48:10 +00:00
|
|
|
|
else
|
2007-11-09 14:42:10 +00:00
|
|
|
|
# when STD_INSTALL = 0 or STD_INSTALL = 2
|
|
|
|
|
# STD_INSTALL = 2 is used by myself (JP Charras) to build a statically linked distribution intalled in /usr/local (with STD_INSTALL = 0)
|
2007-09-22 14:31:20 +00:00
|
|
|
|
PREFIX = /usr/local/kicad
|
|
|
|
|
KICAD_BIN = $(PREFIX)/linux
|
|
|
|
|
KICAD_PLUGINS = $(KICAD_BIN)/plugins
|
2007-07-02 12:48:10 +00:00
|
|
|
|
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
|
|
|
|
|
|
2007-06-14 16:28:05 +00:00
|
|
|
|
# http://www.gnu.org/software/autoconf/manual/make/Catalogue-of-Rules.html#Catalogue-of-Rules
|
|
|
|
|
CXX = g++
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
SRCSUFF = .cpp
|
|
|
|
|
OBJSUFF = .o
|
|
|
|
|
FINAL = 1
|
|
|
|
|
|
2007-06-14 16:28:05 +00:00
|
|
|
|
|
2007-07-09 09:29:53 +00:00
|
|
|
|
# turn on/OFF debugging for all executables, only tested without KICAD_PYTHON
|
2008-02-12 21:12:46 +00:00
|
|
|
|
DEBUG = 1
|
2007-06-14 16:28:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# common CPPFLAGS to all components, further CPPFLAGS customization in
|
|
|
|
|
# directory specific makefile.gtk files.
|
2007-06-15 07:16:40 +00:00
|
|
|
|
ifeq ($(DEBUG), 1)
|
2007-08-01 16:22:57 +00:00
|
|
|
|
WXXFLAGS := $(shell wx-config --debug --cxxflags)
|
2008-02-12 21:12:46 +00:00
|
|
|
|
CPPFLAGS = -Wall -g3 -ggdb3 ${WXXFLAGS} -fno-strict-aliasing -DDEBUG -D_UNICODE
|
2007-08-04 04:41:36 +00:00
|
|
|
|
LDFLAGS = -g3 -ggdb3 #-v
|
2007-06-14 16:28:05 +00:00
|
|
|
|
else
|
2007-08-01 16:22:57 +00:00
|
|
|
|
WXXFLAGS := $(shell wx-config --cxxflags)
|
2008-02-12 21:12:46 +00:00
|
|
|
|
CPPFLAGS = -Wall -O2 ${WXXFLAGS} -fno-strict-aliasing -D_UNICODE
|
2007-06-14 16:28:05 +00:00
|
|
|
|
LDFLAGS = -s #-v
|
|
|
|
|
endif
|
2007-08-02 02:04:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# a command line define which affects pcbnew only, causing it to match current layer
|
|
|
|
|
ifdef USE_MATCH_LAYER
|
2008-02-12 21:12:46 +00:00
|
|
|
|
CPPFLAGS += -DUSE_MATCH_LAYER
|
2007-08-02 02:04:45 +00:00
|
|
|
|
endif
|
2007-06-14 16:28:05 +00:00
|
|
|
|
|
|
|
|
|
|
2007-07-09 09:29:53 +00:00
|
|
|
|
|
|
|
|
|
ifeq ($(KICAD_STATIC_LINK), 1)
|
|
|
|
|
LD = gcc
|
|
|
|
|
else
|
|
|
|
|
LD = g++
|
|
|
|
|
endif
|
2007-05-28 18:09:49 +00:00
|
|
|
|
|
|
|
|
|
ifdef KICAD_PYTHON
|
2007-06-14 16:28:05 +00:00
|
|
|
|
PYTHON_VERSION=2.5
|
2007-05-28 18:09:49 +00:00
|
|
|
|
PYLIBS= -L/usr/lib
|
|
|
|
|
PYLIBS+= -L /usr/include/python
|
|
|
|
|
PYLIBS+= -lpython$(PYTHON_VERSION)
|
2007-09-08 18:12:51 +00:00
|
|
|
|
PYLIBS+= -lboost_python-mt
|
2007-05-28 18:09:49 +00:00
|
|
|
|
EXTRACPPFLAGS+=-I /usr/include/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing
|
|
|
|
|
endif
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
# 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
|
2007-06-11 19:33:59 +00:00
|
|
|
|
ifeq ($(KICAD_STATIC_LINK), 1)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
#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!!)
|
2007-08-04 04:41:36 +00:00
|
|
|
|
LIBSTDC = #-lstdc++ is implied when using g++ to link
|
2007-05-06 16:03:28 +00:00
|
|
|
|
endif
|
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
LIBVERSION=`wx-config --release`
|
2007-05-28 18:09:49 +00:00
|
|
|
|
LIBREGEX=$(WXPATH)/libwxregexu-$(LIBVERSION).a
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
# use link static for wxWidgets
|
2007-06-11 19:33:59 +00:00
|
|
|
|
ifeq ($(KICAD_STATIC_LINK), 1)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
LIBS3D = $(WXPATH)/$(PREFIX_WX_LIBS)$(SUFFIX_WX_LIBGL)\
|
|
|
|
|
$(MESALIBSPATH)/libGL.a $(MESALIBSPATH)/libGLU.a
|
|
|
|
|
|
2007-09-22 14:31:20 +00:00
|
|
|
|
AUXLIB = -lXxf86vm
|
|
|
|
|
#AUXLIB = /usr/X11R6/lib/libXinerama.a
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
WXSYSLIB= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \
|
|
|
|
|
$(WXPATH)/libwxpng-$(LIBVERSION).a\
|
|
|
|
|
$(WXPATH)/libwxjpeg-$(LIBVERSION).a\
|
|
|
|
|
$(WXPATH)/libwxzlib-$(LIBVERSION).a\
|
2007-05-28 18:09:49 +00:00
|
|
|
|
$(LIBREGEX)\
|
2007-09-22 14:31:20 +00:00
|
|
|
|
$(AUXLIB)\
|
2007-05-06 16:03:28 +00:00
|
|
|
|
-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\
|
2007-05-28 18:09:49 +00:00
|
|
|
|
-L/usr/lib $(PYLIBS)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
|
2007-09-22 14:31:20 +00:00
|
|
|
|
WXSYSLIB_WITH_GL= $(WXSYSLIB) $(LIBS3D)
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
else
|
2007-06-14 16:28:05 +00:00
|
|
|
|
|
2007-06-15 07:16:40 +00:00
|
|
|
|
ifeq ($(DEBUG), 1)
|
2007-06-14 16:28:05 +00:00
|
|
|
|
# debug wxWidgets
|
|
|
|
|
WXSYSLIB= `wx-config --debug --libs std`
|
|
|
|
|
WXSYSLIB_WITH_GL= `wx-config --debug --libs std,gl`
|
|
|
|
|
else
|
|
|
|
|
# or use "standard command" for wxWidgets
|
2007-05-06 16:03:28 +00:00
|
|
|
|
WXSYSLIB= `wx-config --libs std`
|
|
|
|
|
WXSYSLIB_WITH_GL= `wx-config --libs std,gl`
|
|
|
|
|
endif
|
|
|
|
|
|
2007-06-14 16:28:05 +00:00
|
|
|
|
endif
|
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
2008-02-12 21:12:46 +00:00
|
|
|
|
# attention <20> l'ordre des libairies
|
2007-05-06 16:03:28 +00:00
|
|
|
|
LIBS = -L/usr/local/lib -L/usr/X11R6/lib\
|
|
|
|
|
$(EXTRALIBS) $(WXSYSLIB)\
|
2007-05-28 18:09:49 +00:00
|
|
|
|
$(LIBSTDC) $(PYLIBS)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
LIBS_WITH_GL = -L/usr/local/lib -L/usr/X11R6/lib\
|
|
|
|
|
$(EXTRALIBS) $(WXSYSLIB_WITH_GL)\
|
2007-05-28 18:09:49 +00:00
|
|
|
|
$(LIBSTDC) $(PYLIBS)
|