Browse files

Turn on -O2 by default.

  • Loading branch information...
1 parent cc948cc commit 9f7bb1ea9eb585f92e973cab1b27d77d575fe63d @vstakhov committed Feb 25, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 Makefile.unix
  2. +1 −1 Makefile.w32
View
2 Makefile.unix
@@ -20,7 +20,7 @@ LN ?= ln
LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
LD_ADD ?= -lrt
-COPT_FLAGS ?= -g -O0
+COPT_FLAGS ?= -O2
@jbergstroem
jbergstroem added a line comment Feb 26, 2014

Why not just have it as part of CFLAGS? That way you won't get duplicate flags when passing your own CFLAGS - for instance:

$ # Now I have to unset COPT_FLAGS to get control over CFLAGS
$ CFLAGS="-march=native -O2 -pipe" COPT_FLAGS= make
@vstakhov
Owner
vstakhov added a line comment Feb 26, 2014

This is just a convenient tool to enable/disable optimizations without touching the whole CFLAGS argument that can include some mandatory parts, such as include paths or PIC arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h
OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o
View
2 Makefile.w32
@@ -23,7 +23,7 @@ endif
LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
LD_ADD ?= -lrt
-COPT_FLAGS ?= -g -O0
+COPT_FLAGS ?= -O2
HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h
OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o

0 comments on commit 9f7bb1e

Please sign in to comment.