1#$Id: Make2.Debug,v 26.138 2013/04/24 03:03:11 al Exp $ -*- Makefile -*- 2# Copyright (C) 2001 Albert Davis 3# Author: Albert Davis <aldavis@gnu.org> 4# 5# This file is part of "Gnucap", the Gnu Circuit Analysis Package 6# 7# This program is free software; you can redistribute it and/or modify 8# it under the terms of the GNU General Public License as published by 9# the Free Software Foundation; either version 3, or (at your option) 10# any later version. 11# 12# This program is distributed in the hope that it will be useful, 13# but WITHOUT ANY WARRANTY; without even the implied warranty of 14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15# GNU General Public License for more details. 16# 17# You should have received a copy of the GNU General Public License 18# along with this program; if not, write to the Free Software 19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20# 02110-1301, USA. 21#------------------------------------------------------------------------ 22VPATH = .:.. 23 24# Standard base for g++, debugging, a little optimization 25# Running the program will give a spew of line markers for debugging. 26 27CCC = g++ 28TARGET_EXT = .so 29 30CCFLAGS = \ 31-fPIC \ 32-DHAVE_LIBREADLINE \ 33-DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \ 34-Wall -Wextra \ 35-Wswitch-enum -Wundef -Wpointer-arith -Woverloaded-virtual \ 36-Wcast-qual -Wcast-align -Wpacked -Wshadow -Wconversion \ 37-Winit-self -Wmissing-include-dirs -Winvalid-pch \ 38-Wvolatile-register-var -Wstack-protector \ 39-Wlogical-op -Wvla -Woverlength-strings -Wsign-conversion 40#last line not in 4.1 41 42LIBS = \ 43-lreadline -ltermcap \ 44 45LDFLAGS = -shared 46 47%.SUFFIXES: 48.SUFFIXES: .o .cc 49.cc.o:; $(CCC) $(CCFLAGS) -c $< 50#------------------------------------------------------------------------ 51$(TARGET)$(TARGET_EXT): $(TARGET_DEPENDS) 52 rm -f $@ 53 $(CCC) $(CCFLAGS) $(OBJS) $(LIBS) $(LDFLAGS) -o $@ 54#------------------------------------------------------------ 55# warnings turned off, because they warn of nothing wrong 56# 4.3 57#-Wswitch-default -- lack of default is correct with enum 58#-Wfloat-equal -- warns on NA, div by zero trap 59#-Wpadded -- a bool in a class is enough 60#-Wredundant-decls -- in both header and func is an error check 61#-Wmissing-declarations -- pascal style 62#-Wmissing-noreturn -- warns when always throws exception 63#-Wunreachable-code -- warns even if reachable .. compiler bug?? 64#-Waggregate-return -- warns even if passed by reference 65#-Wunsafe-loop-optimizations -- if can't unroll a loop 66#-Winline 67#-Wdisabled-optimization -- -O0 disables optimization, so it warns 68 69# 4.2 70#-Wpadded -- a bool in a class is enough 71#-Winline 72#-Waggregate-return -- warns even if passed by reference 73#-Wfloat-equal -- warns on NA, div by zero trap 74#-Wredundant-decls -- in both header and func is an error check 75#-Wunsafe-loop-optimizations -- warns on any loop with variable count 76 77# warnings turned off, because of the public headers 78#-Wunreachable-code -- didn't use nonportable syntax to hide 79#-Wmissing-noreturn -- didn't use nonportable syntax to hide 80 81# warnings that should be on, but ... 82#-Wshadow -- lambda functions 83#------------------------------------------------------------ 84# If you are porting and using g++, you should use this file as a start, 85# for a "debug" version, with extra warnings and run-time tracing. 86# If you get errors or warnings, make a copy of it and modify that. 87# After it works, use the file "Make2.g++" as a start for 88# executable to use. 89# If the port is non-trivial, check with me first because someone else 90# may have already done it. 91# If it works without changes, send me a note so I can put it in the docs. 92# Please send the changes to aldavis@gnu.org 93#------------------------------------------------------------ 94#------------------------------------------------------------ 95