Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use SHIPFLAGS and DEBUGFLAGS from Make.inc everywhere.

Allow switching between gcc and clang.
  • Loading branch information...
commit 38352a32e6a4cc2e6e7f51e2f16d0da23fc629b9 1 parent 61f834d
@ViralBShah ViralBShah authored
View
24 Make.inc
@@ -4,15 +4,27 @@ EXTROOTLIB = $(EXTROOT)/lib
LLVMROOT = $(EXTROOT)
OS = $(shell uname)
+USEGCC = 1
+USECLANG = 0
+
+ifeq ($(USEGCC),1)
CC = gcc
CXX = g++
FC = gfortran
-#CC = $(EXTROOT)/bin/clang
-#CXX = $(EXTROOT)/bin/clang++
-CFLAGS = -std=gnu99 -fPIC -D_FORTIFY_SOURCE=0
-CXXFLAGS = -fPIC -D_FORTIFY_SOURCE=0 -fno-rtti
-DEBUGFLAGS = -ggdb3 -DDEBUG $(FLAGS)
-SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
+CFLAGS = -pipe -std=gnu99 -fPIC -D_FORTIFY_SOURCE=0
+CXXFLAGS = -pipe -fPIC -D_FORTIFY_SOURCE=0 -fno-rtti
+DEBUGFLAGS = -ggdb3 -DDEBUG
+SHIPFLAGS = -O3 -DNDEBUG
+endif
+
+ifeq ($(USECLANG),1)
+CC = $(EXTROOT)/bin/clang
+CXX = $(EXTROOT)/bin/clang++
+CFLAGS = -fPIC -fexceptions -pipe
+CXXFLAGS = -fPIC -fno-rtti -fexceptions -pipe
+DEBUGFLAGS = -g -DDEBUG
+SHIPFLAGS = -O4 -DNDEBUG
+endif
DEFAULT_REPL = readline
JULIAGC = MARKSWEEP
View
4 src/Makefile
@@ -14,8 +14,8 @@ FLAGS = -falign-functions -Wall -Wno-strict-aliasing \
-fno-omit-frame-pointer \
-I$(FLISPDIR) -I$(LLTDIR) $(HFILEDIRS:%=-I%) $(LIBDIRS:%=-L%) \
-I$(shell $(LLVMROOT)/bin/llvm-config --includedir) -fvisibility=hidden
-DEBUGFLAGS = -ggdb3 -DDEBUG $(FLAGS)
-SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
+DEBUGFLAGS += $(FLAGS)
+SHIPFLAGS += $(FLAGS)
LIBFILES = $(FLISP) $(LLT)
LIBS = $(LIBFILES) -L$(EXTROOT)/lib -lutil -ldl -lm $(OSLIBS) \
View
4 src/flisp/Makefile
@@ -17,8 +17,8 @@ FLAGS = -falign-functions -Wall -Wno-strict-aliasing -I$(LLTDIR) $(CFLAGS) \
LIBFILES = $(LLT)
LIBS = $(LIBFILES) -lm $(GCLIBS)
-DEBUGFLAGS = -g -ggdb3 -DDEBUG $(FLAGS)
-SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
+DEBUGFLAGS += $(FLAGS)
+SHIPFLAGS += $(FLAGS)
default: release
View
4 src/support/Makefile
@@ -11,8 +11,8 @@ TARGET = libllt.a
FLAGS = -Wall -Wno-strict-aliasing $(CFLAGS) $(HFILEDIRS:%=-I%) -fvisibility=hidden
LIBS =
-DEBUGFLAGS = -g -DDEBUG $(FLAGS)
-SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
+DEBUGFLAGS += $(FLAGS)
+SHIPFLAGS += $(FLAGS)
default: release
View
4 ui/Makefile
@@ -11,8 +11,8 @@ READLINE = -lncurses $(EXTROOT)/lib/libreadline.a
FLAGS = -falign-functions -Wall -Wno-strict-aliasing \
-fno-omit-frame-pointer \
-I$(JULIAHOME)/src -I$(LLTDIR) -I$(EXTROOT)/include $(CFLAGS)
-DEBUGFLAGS = -ggdb3 -DDEBUG $(FLAGS)
-SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
+DEBUGFLAGS += $(FLAGS)
+SHIPFLAGS += $(FLAGS)
LIBJULIA_RELEASE = $(JULIAHOME)/libjulia-release.$(SHLIB_EXT)
LIBJULIA_DEBUG = $(JULIAHOME)/libjulia-debug.$(SHLIB_EXT)
View
5 ui/webserver/Makefile
@@ -1,7 +1,6 @@
JULIAHOME = $(shell pwd)/../..
include $(JULIAHOME)/Make.inc
-CPP = g++
LIBS = -lpthread
LIBJULIA_RELEASE = $(JULIAHOME)/libjulia-release.$(SHLIB_EXT)
@@ -18,8 +17,8 @@ WEBSERVER_OBJS = webserver.o server.o network.o
julia-debug julia-release: webserver
webserver: $(WEBSERVER_SRCS)
- $(CPP) $(CXXFLAGS) $(SHIPFLAGS) -I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -c $(WEBSERVER_SRCS)
- $(CPP) -o $@ $(SHIPFLAGS) $(WEBSERVER_OBJS) $(LIBJULIA_RELEASE) $(LIBS)
+ $(CXX) $(CXXFLAGS) $(SHIPFLAGS) -I$(JULIAHOME)/src -I$(JULIAHOME)/src/support -c $(WEBSERVER_SRCS)
+ $(CXX) -o $@ $(SHIPFLAGS) $(WEBSERVER_OBJS) $(LIBJULIA_RELEASE) $(LIBS)
cp webserver $(JULIAHOME)/webserver
clean:
Please sign in to comment.
Something went wrong with that request. Please try again.