Skip to content

Commit

Permalink
commmon: allow appending extra CFLAGS/LDFLAGS via command line
Browse files Browse the repository at this point in the history
With this change, user may provide the extra flags CFLAGS/LDFLAGS using
the following syntax:

Example #1:
> make EXTRA_CFLAGS=-finstrument-functions <target>

Example #2:
> CFLAGS=-finstrument-functions make <target>
  • Loading branch information
krzycz committed Nov 10, 2014
1 parent 612d9ec commit 9b70e63
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ vpath %.c ..
vpath %.h .. ../include
INCS = -I.. -I../include

CFLAGS += -std=gnu99 -Wall -Werror
LDFLAGS = -Wl,-z,relro
CFLAGS += -std=gnu99 -Wall -Werror $(EXTRA_CFLAGS)
LDFLAGS += -Wl,-z,relro $(EXTRA_LDFLAGS)

LN = ln
PMEMSOVERSION = 1
Expand Down
2 changes: 1 addition & 1 deletion src/debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# src/debug/Makefile -- build the debug versions of the NVM Library
#

CFLAGS = -ggdb -DDEBUG
CFLAGS += -ggdb -DDEBUG
JEMALLOC_OBJROOT = debug

VARIANT_DESTDIR = nvml_debug
Expand Down
2 changes: 1 addition & 1 deletion src/jemalloc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
--with-private-namespace=je_vmem_
--disable-xmalloc
--disable-munmap
EXTRA_CFLAGS="-DJEMALLOC_LIBVMEM -Werror"
EXTRA_CFLAGS="-DJEMALLOC_LIBVMEM"

2 changes: 1 addition & 1 deletion src/nondebug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# src/nondebug/Makefile -- build the nondebug versions of the NVM Library
#

CFLAGS = -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
CFLAGS += -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
JEMALLOC_OBJROOT = nondebug

include ../Makefile.inc

0 comments on commit 9b70e63

Please sign in to comment.