From dc7235c7694b3ac02cca5f9a1469b925942c2ded Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Thu, 14 Jun 2007 16:28:05 +0000 Subject: [PATCH] Gathered up common compiler and linker flags for the makefile.gtk file set. Much easier now to compile with debugging symbols enabled. --- 3d-viewer/makefile.gtk | 10 +++------- common/makefile.gtk | 7 ++++--- cvpcb/makefile.gtk | 15 ++++----------- eeschema/makefile.gtk | 13 ++++--------- gerbview/makefile.gtk | 12 ++++-------- kicad/makefile.gtk | 14 +++++--------- libs.linux | 32 ++++++++++++++++++++++++++++++-- makefile.gtk | 1 + pcbnew/makefile.gtk | 16 ++++------------ 9 files changed, 59 insertions(+), 61 deletions(-) diff --git a/3d-viewer/makefile.gtk b/3d-viewer/makefile.gtk index d094d942d9..50a949e0e4 100644 --- a/3d-viewer/makefile.gtk +++ b/3d-viewer/makefile.gtk @@ -1,14 +1,10 @@ ## Makefile for 3d-viewer.a ( wxGTK - LINUX ) -CC = gcc - -# Compiler flags. - -CPPFLAGS = -Wall -O2 -DPCBNEW -I../pcbnew -I ../include -I../common\ - `wx-config --cxxflags` -fno-strict-aliasing - include ../libs.linux +# Compiler flags. +CPPFLAGS += -DPCBNEW -I../pcbnew -I ../include -I../common + TARGET = 3d-viewer FINAL = 1 diff --git a/common/makefile.gtk b/common/makefile.gtk index 9abef6217e..9597a08ecd 100644 --- a/common/makefile.gtk +++ b/common/makefile.gtk @@ -1,15 +1,16 @@ ## Makefile for common.a CC = gcc + +include ../libs.linux + # Compiler flags. -CPPFLAGS = -Wall -O2 -I./ -I../include `wx-config --cflags` +CPPFLAGS += -I./ -I../include EDACPPFLAGS = $(CPPFLAGS) all: common.a -include ../libs.linux - include makefile.include CPPFLAGS += $(EXTRACPPFLAGS) -fno-strict-aliasing diff --git a/cvpcb/makefile.gtk b/cvpcb/makefile.gtk index dbffd54cf2..5ce33231b6 100644 --- a/cvpcb/makefile.gtk +++ b/cvpcb/makefile.gtk @@ -1,21 +1,14 @@ # File: makefile -# Compiler flags. -CC = gcc -LD = gcc - FINAL = 1 -# Compiler flags. - -CPPFLAGS = -Wall -O2 `wx-config --cxxflags` - -LDFLAGS = -s - -EDACPPFLAGS = $(CPPFLAGS) include ../libs.linux +# Compiler flags. +CPPFLAGS += + +EDACPPFLAGS = $(CPPFLAGS) TARGET = cvpcb diff --git a/eeschema/makefile.gtk b/eeschema/makefile.gtk index eddd4d52c2..04c1a2e15e 100644 --- a/eeschema/makefile.gtk +++ b/eeschema/makefile.gtk @@ -1,20 +1,15 @@ ## Makefile for eeschema -CC = gcc -#LD = c++ pour utiliser libstdc++ dynamique -LD = gcc -FINAL = 1 - - -LDFLAGS = -s include ../libs.linux + +# Additional compiler flags +CPPFLAGS += + TARGET = eeschema -CPPFLAGS = -Wall -O2 `wx-config --cxxflags` - all: $(TARGET) diff --git a/gerbview/makefile.gtk b/gerbview/makefile.gtk index 237969bc39..8d0930071e 100644 --- a/gerbview/makefile.gtk +++ b/gerbview/makefile.gtk @@ -1,14 +1,11 @@ ## Makefile for GERBVIEW et wxGTK -CC = gcc -LD = gcc -# Compiler flags. -CPPFLAGS = -Wall -O2 `wx-config --cxxflags` - -LDFLAGS = -s include ../libs.linux +# Additional compiler flags. +CPPFLAGS += + TARGET = gerbview @@ -34,5 +31,4 @@ clean: rm -f *.map rm -f $(TARGET) - - + \ No newline at end of file diff --git a/kicad/makefile.gtk b/kicad/makefile.gtk index 571c523b25..edd0048cfd 100644 --- a/kicad/makefile.gtk +++ b/kicad/makefile.gtk @@ -1,17 +1,13 @@ # File: makefile for kicad, wxGTK -# Compiler flags. -CC = gcc -LD = gcc - -FINAL = 1 - -# Compiler flags. -CPPFLAGS = -Wall -O2 `wx-config --cxxflags` -LDFLAGS = -s include ../libs.linux +# Additional compiler flags +CPPFLAGS += + +FINAL = 1 + TARGET = kicad all: $(TARGET) diff --git a/libs.linux b/libs.linux index c336074583..e8b21de65c 100644 --- a/libs.linux +++ b/libs.linux @@ -3,11 +3,31 @@ KICAD_BIN = /usr/local/kicad KICAD_PLUGINS = $(KICAD_BIN)/plugins +# http://www.gnu.org/software/autoconf/manual/make/Catalogue-of-Rules.html#Catalogue-of-Rules +CXX = g++ +LD = g++ + SRCSUFF = .cpp OBJSUFF = .o FINAL = 1 + +# turn on debugging for all executables, only tested without KICAD_PYTHON +DEBUG = 1 + + +# common CPPFLAGS to all components, further CPPFLAGS customization in +# directory specific makefile.gtk files. +ifdef DEBUG +CPPFLAGS = -Wall -g `wx-config --debug --cxxflags` -fno-strict-aliasing +LDFLAGS = -g #-v +else +CPPFLAGS = -Wall -O2 `wx-config --cxxflags` -fno-strict-aliasing +LDFLAGS = -s #-v +endif + + # You must comment or uncomment this line to disable/enable python support #KICAD_PYTHON = 1 @@ -19,7 +39,7 @@ FINAL = 1 #endif ifdef KICAD_PYTHON -PYTHON_VERSION=2.3 +PYTHON_VERSION=2.5 PYLIBS= -L/usr/lib PYLIBS+= -L /usr/include/python PYLIBS+= -lpython$(PYTHON_VERSION) @@ -79,11 +99,19 @@ WXSYSLIB_WITH_GL= $(WXPATH)/$(PREFIX_WX_LIBS)-$(LIBVERSION).a \ -lglib-2.0 -lpangoft2-1.0 -lSM\ -L/usr/lib $(PYLIBS) else -#or use "standard command" for wxWidgets + +ifdef DEBUG +# 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\ diff --git a/makefile.gtk b/makefile.gtk index f214af22e2..cf23f5ca64 100644 --- a/makefile.gtk +++ b/makefile.gtk @@ -1,3 +1,4 @@ + MAKE = make -f makefile.gtk KICAD_SUBDIRS = common 3d-viewer eeschema eeschema/plugins pcbnew cvpcb kicad gerbview KICAD_SUBDIRS_BIN = eeschema eeschema/plugins pcbnew cvpcb kicad gerbview diff --git a/pcbnew/makefile.gtk b/pcbnew/makefile.gtk index 14565cef75..bfc9c8a3f6 100644 --- a/pcbnew/makefile.gtk +++ b/pcbnew/makefile.gtk @@ -1,19 +1,12 @@ ## Makefile for PCBNEW et wxGTK -CC = gcc -LD = gcc -#DEBUG = 1 -# Compiler flags. -ifdef DEBUG -CPPFLAGS = -Wall -g `wx-config --cxxflags` -LDFLAGS = -g -else -CPPFLAGS = -Wall -O2 `wx-config --cxxflags` -LDFLAGS = -s -endif include ../libs.linux +# Additional compiler flags +CPPFLAGS += + + TARGET = pcbnew all: $(TARGET) @@ -24,7 +17,6 @@ CPPFLAGS += $(EXTRACPPFLAGS) EDACPPFLAGS = $(CPPFLAGS) - $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(LIBVIEWER3D) $(EXTRALIBS) ../libs.linux $(LD) $(LDFLAGS) $(OBJECTS) $(LIBVIEWER3D) $(LIBS_WITH_GL)\ -o $(TARGET)