diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/config.mk | 9 | ||||
-rw-r--r-- | build/exe.mk | 6 | ||||
-rw-r--r-- | build/lib.mk | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/build/config.mk b/build/config.mk index dd19ef90..c2ec1602 100644 --- a/build/config.mk +++ b/build/config.mk @@ -21,8 +21,13 @@ DEFAULT_BUILD = release -debug : BUILD = debug -release : BUILD = release +debug : BUILD = debug +valgrind : BUILD = debug +release : BUILD = release + +debug : LINKAGE = -static +valgrind : LINKAGE = -dynamic +release : LINKAGE = -static all default: $(DEFAULT_BUILD) diff --git a/build/exe.mk b/build/exe.mk index c931bfdd..bc16463d 100644 --- a/build/exe.mk +++ b/build/exe.mk @@ -29,11 +29,9 @@ CC = gcc CCC = g++ endif NASM = nasm -# LINKAGE can be forced to -static or -dynamic from invocation if desired, but it defaults to -static except on OSX +# override to -dynamic on OSX ifeq ($(DARWIN_BUILD),yes) LINKAGE = -dynamic -else -LINKAGE = -static endif LINK = $(CC) $(LINKAGE) OBJPATH = $(topdir)/obj @@ -48,6 +46,7 @@ DEBUG_PROGRAM = $(DEBUG_BINPATH)/$(PROGRAM_NAME) RELEASE_PROGRAM = $(RELEASE_BINPATH)/$(PROGRAM_NAME) debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) LFLAGS = -L$(LIBPATH) @@ -58,6 +57,7 @@ DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp= RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o) debug : $(ORDINALS_H) $(DEBUG_PROGRAM) +valgrind: $(ORDINALS_H) $(DEBUG_PROGRAM) release : $(ORDINALS_H) $(RELEASE_PROGRAM) $(DEBUG_PROGRAM) : $(DEBUG_OBJS) diff --git a/build/lib.mk b/build/lib.mk index bec4fcb5..d0d80a2c 100644 --- a/build/lib.mk +++ b/build/lib.mk @@ -56,6 +56,7 @@ LINKD = $(CC) -shared endif debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) +valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) LFLAGS = -L$(LIBPATH) @@ -66,6 +67,7 @@ DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp= RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o) debug : $(ORDINALS_H) $(DEBUG_STATIC_LIB) $(DEBUG_DYNAMIC_LIB) +valgrind: $(ORDINALS_H) $(DEBUG_STATIC_LIB) $(DEBUG_DYNAMIC_LIB) release : $(ORDINALS_H) $(RELEASE_STATIC_LIB) $(RELEASE_DYNAMIC_LIB) $(DEBUG_STATIC_LIB): $(DEBUG_OBJS) |