1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
--- libs.FreeBSD.orig 2008-09-21 21:25:03.000000000 +0200
+++ libs.FreeBSD 2008-09-21 23:12:06.000000000 +0200
@@ -18,7 +18,7 @@
# 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.
-STD_INSTALL = 0
+STD_INSTALL = 1
#*******************************************
#*******************************************
@@ -34,17 +34,16 @@
endif
ifeq ($(STD_INSTALL), 1) # Used to build linux distribs
-PREFIX = /usr # (can also be /usr/local)
KICAD_BIN = $(PREFIX)/bin # Install main binaries here
KICAD_PLUGINS = $(KICAD_BIN) # Install other binaries here
KICAD_DOCS=$(PREFIX)/share/doc/kicad # Install doc files here
-KICAD_DATA=$(PREFIX)/share/kicad # Install libraries and others files here
+# Install libraries and others files here
+KICAD_DATA = $(PREFIX)/share/kicad
else # Install ALL files in /usr/local/kicad
# when STD_INSTALL = 0 or STD_INSTALL = 2
# STD_INSTALL = 0 is used to build kicad intalled in /usr/local
# STD_INSTALL = 2 is used by myself (JP Charras) to build a statically linked distribution intalled in /usr/local
-PREFIX = /usr/local/kicad
KICAD_BIN = $(PREFIX)/bin
KICAD_PLUGINS = $(KICAD_BIN)/plugins
KICAD_DOCS=$(PREFIX)/help
@@ -57,7 +56,7 @@
KICAD_TEMPLATE=$(KICAD_DATA)/template
# define compil and link
-LD = g++
+LD = $(CXX)
SRCSUFF = .cpp
OBJSUFF = .o
@@ -71,12 +70,12 @@
# 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 -D_UNICODE
-LDFLAGS = -g3 -ggdb3 #-v
+WXXFLAGS := `${WX_CONFIG} --debug --cxxflags`
+CPPFLAGS = -Wall -g ${WXXFLAGS} -fno-strict-aliasing -DDEBUG -D_UNICODE
+LDFLAGS = -g #-v
else
-WXXFLAGS := $(shell wx-config --cxxflags)
-CPPFLAGS = -Wall -O2 ${WXXFLAGS} -fno-strict-aliasing -D_UNICODE
+WXXFLAGS := `${WX_CONFIG} --cxxflags`
+CPPFLAGS+= -Wall ${WXXFLAGS} -fno-strict-aliasing -D_UNICODE
LDFLAGS = -s #-v
endif
@@ -88,28 +87,28 @@
ifdef KICAD_PYTHON
PYTHON_VERSION=2.5
-PYLIBS= -L/usr/lib
-PYLIBS+= -L /usr/include/python
+PYLIBS= -L${LOCALBASE}/lib
+PYLIBS+= -L${LOCALBASE}/lib/python$(PYTHON_VERSION)
PYLIBS+= -lpython$(PYTHON_VERSION)
PYLIBS+= -lboost_python-mt
-EXTRACPPFLAGS+=-I /usr/include/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing
+EXTRACPPFLAGS+=-I ${LOCALBASE}/python$(PYTHON_VERSION) -DKICAD_PYTHON -fno-strict-aliasing
endif
# mesa (free opengl library) libs
-MESALIBSPATH = /usr/local/lib
+MESALIBSPATH = ${LOCALBASE}/lib
#for static link: add wx gl lib
-LIBVERSION=`wx-config --release`
-WXPATH = `wx-config --prefix`/lib
-PREFIX_WX_LIBS = lib`wx-config --basename`
+LIBVERSION=`${WX_CONFIG} --release`
+WXPATH = `${WX_CONFIG} --prefix`/lib
+PREFIX_WX_LIBS = lib`${WX_CONFIG} --basename`
SUFFIX_WX_LIBGL = _gl-$(LIBVERSION).a
ifeq ($(DEBUG), 1)
# debug wxWidgets
-WXSYSLIB= `wx-config --debug --libs std`
+WXSYSLIB= `${WX_CONFIG} --debug --libs std`
else
# or use "standard command" for wxWidgets
-WXSYSLIB= `wx-config --libs std`
+WXSYSLIB= `${WX_CONFIG} --libs std`
endif
# use link static
@@ -119,16 +118,16 @@
else
ifeq ($(DEBUG), 1)
-WXSYSLIB_WITH_GL= `wx-config --debug --libs std,gl`
+WXSYSLIB_WITH_GL= `${WX_CONFIG} --debug --libs std,gl`
else
-WXSYSLIB_WITH_GL= `wx-config --libs std,gl`
+WXSYSLIB_WITH_GL= `${WX_CONFIG} --libs std,gl`
endif
endif
# attention a l'ordre des libairies
-LIBS = -L/usr/local/lib -L/usr/X11R6/lib\
+LIBS = -L${LOCALBASE}/lib \
$(EXTRALIBS) $(WXSYSLIB) $(PYLIBS)
-LIBS_WITH_GL = -L/usr/local/lib -L/usr/X11R6/lib\
+LIBS_WITH_GL = -L${LOCALBASE}/lib \
$(EXTRALIBS) $(WXSYSLIB_WITH_GL) $(PYLIBS)
|