1 #*************************************************************************
3 #*************************************************************************
14 #*************************************************************************
15 # System-specific compilation flags
16 #*************************************************************************
17 # Get some basic information about the system that you are working on
18 cputype = $(shell uname -m | sed "s/\\ /_/g")
19 systype = $(shell uname)
20 ifeq ($(findstring CYGWIN, $(systype)),CYGWIN)
27 GKLIBINCDIR = $(HOME)/work/algorithms/GKlib/trunk/
28 GKLIBBUILDDIR = $(HOME)/work/algorithms/GKlib/builds/$(systype)-$(cputype)
31 ifeq ($(systype),MSWIN)
32 #-------------------------------------------------------------------
33 # These defs are very much Visual Studio Specific
34 #-------------------------------------------------------------------
38 COPTIONS = -DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE
40 #Compile input/output file specification
44 #Output specification for executables
45 EXEOUTPUTFILE = /Fe$@ # This option is when cl is used for linking
46 #EXEOUTPUTFILE = /OUT:$@ # This option is used when link is used for linking
50 #LD = /cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 8/VC/BIN/link
54 #Library creation information
59 COPTIONS += -D__OPENMP__ /openmp
61 MERGEMANIFEST = vc_mt -manifest $@.manifest -outputresource:$@\;1
65 ifeq ($(cputype),i386)
66 LIBPLOTDIR = ../Libplot/Win32
68 LIBPLOTDIR = ../Libplot/Win64
70 LIBS = $(LIBPLOTDIR)/libplot.lib $(BUILDDIR)/libcluto.lib $(GKLIBBUILDDIR)/libGKlib.lib
72 # Standard file extensions
77 ifeq ($(systype),Linux)
78 ifeq ($(x86compiler),gcc)
82 COPTIONS = -DLINUX -D_FILE_OFFSET_BITS=64 -pedantic -std=c99 -pthread
90 #Library creation information
97 COPTIONS = -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99
103 #Library creation information
108 COPTIONS += -D__OPENMP__ -openmp -openmp-report2
114 ifeq ($(cputype),x86_64)
115 LIBPLOTDIR = ../Libplot/Linux64
117 LIBPLOTDIR = ../Libplot/Linux32
122 ifeq ($(systype),SunOS)
123 #Compiler information
124 CC = /opt/SUNWspro/bin/cc
130 LD = /opt/SUNWspro/bin/cc
133 #Library creation information
138 LIBPLOTDIR = ../Libplot/SunOS
142 ifeq ($(systype),Darwin)
143 #Compiler information
146 COPTIONS = -DDARWIN -D_FILE_OFFSET_BITS=64 -pedantic -std=c99
149 LDOPTIONS = -fvisibility=default
152 #Library creation information
157 ifeq ($(cputype),i386)
158 LIBPLOTDIR = ../Libplot/Darwini386
160 LIBPLOTDIR = ../Libplot/DarwinPPC
164 ifeq ($(systype),CYGWIN)
165 #Compiler information
168 COPTIONS = -DCYGWIN -DWIN32 -D_FILE_OFFSET_BITS=64 -Wall -std=c99 -pedantic -mno-cygwin
171 LDOPTIONS = -mno-cygwin
174 #Library creation information
179 LIBPLOTDIR = ../Libplot/CYGWIN
183 #-------------------------------------------------------------------
184 # These defs are common among the GNU/GCC based systems
185 #-------------------------------------------------------------------
186 #Compile input/output file specification
190 #Output specification for executables
191 EXEOUTPUTFILE = -o $@
193 #Library creation information
197 #Libraries needed for linking
198 LIBSDIR = -L$(BUILDDIR) -L$(GKLIBBUILDDIR) -L$(HOME)/local/lib
199 LIBS = -lGKlib -lpcreposix -lpcre -lz -lm
201 # Standard file extensions
208 #**************************************************************************
213 ifeq ($(dmalloc),yes)
214 DMALLOCINC = -I$(HOME)/local/include
215 DMALLOCFLAGS = -DDMALLOC
227 #**************************************************************************
230 #**************************************************************************
231 # Create the build directory if it does not exist
232 #**************************************************************************
233 ifeq ($(systype),Darwin)
236 BINDIR = $(HOME)/work/bin/$(systype)-$(cputype)
237 $(shell mkdir -p $(BINDIR))
241 BUILDDIR = ./builds/$(systype)-$(cputype)
243 BUILDDIR = ./builds/$(systype)-$(cputype)-openmp
246 LIBBUILDDIR = $(BUILDDIR)/lib
247 PRGBUILDDIR = $(BUILDDIR)/prg
248 $(shell mkdir -p $(BUILDDIR))
249 $(shell mkdir -p $(LIBBUILDDIR))
250 $(shell mkdir -p $(PRGBUILDDIR))
255 INCLUDES = -I./ -I$(GKLIBINCDIR) -I$(LIBPLOTDIR) -I$(HOME)/local/include
256 CFLAGS = $(COPTIONS) $(OPTFLAGS) $(DEBUGFLAGS) $(INCLUDES)