Skip to content

Commit

Permalink
Add SKIP_STRIPPING option to Makefiles to allow disabling stripping o…
Browse files Browse the repository at this point in the history
…f binaries (#159)
  • Loading branch information
simonvanderveldt authored and falkTX committed Nov 17, 2019
1 parent a2e733a commit 233e8c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion c++/Makefile.mk
Expand Up @@ -7,6 +7,9 @@
AR ?= ar
CC ?= gcc
CXX ?= g++
MOC ?= $(shell pkg-config --variable=moc_location QtCore)
RCC ?= $(shell pkg-config --variable=rcc_location QtCore)
UIC ?= $(shell pkg-config --variable=uic_location QtCore)
STRIP ?= strip
WINDRES ?= windres

Expand All @@ -22,7 +25,6 @@ DEBUG ?= false
ifeq ($(DEBUG),true)
BASE_FLAGS = -O0 -g -Wall -Wextra
BASE_FLAGS += -DDEBUG
STRIP = true # FIXME
else
BASE_FLAGS = -O3 -ffast-math -Wall -Wextra
BASE_FLAGS += -DNDEBUG
Expand All @@ -38,6 +40,10 @@ ifneq ($(DEBUG),true)
BUILD_CXX_FLAGS += -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM -DQT_NO_DEBUG_OUTPUT
endif

ifneq ($(SKIP_STRIPPING),true)
LINK_FLAGS += -Wl,--strip-all
endif

# --------------------------------------------------------------

# Currently broken
Expand Down
4 changes: 2 additions & 2 deletions c++/jackmeter/Makefile
Expand Up @@ -31,10 +31,10 @@ OBJS = \
all: cadence-jackmeter

cadence-jackmeter: $(FILES) $(OBJS)
$(CXX) $(OBJS) $(LINK_FLAGS) -ldl -o $@ && $(STRIP) $@
$(CXX) $(OBJS) $(LINK_FLAGS) -ldl -o $@

cadence-jackmeter.exe: $(FILES) $(OBJS) icon.o
$(CXX) $(OBJS) icon.o $(LINK_FLAGS) -limm32 -lole32 -luuid -lwinspool -lws2_32 -mwindows -o $@ && $(STRIP) $@
$(CXX) $(OBJS) icon.o $(LINK_FLAGS) -limm32 -lole32 -luuid -lwinspool -lws2_32 -mwindows -o $@

# --------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions c++/xycontroller/Makefile
Expand Up @@ -35,10 +35,10 @@ OBJS = xycontroller.o \
all: cadence-xycontroller

cadence-xycontroller: $(FILES) $(OBJS)
$(CXX) $(OBJS) $(LINK_FLAGS) -ldl -o $@ && $(STRIP) $@
$(CXX) $(OBJS) $(LINK_FLAGS) -ldl -o $@

cadence-xycontroller.exe: $(FILES) $(OBJS) icon.o
$(CXX) $(OBJS) icon.o $(LINK_FLAGS) -limm32 -lole32 -luuid -lwinspool -lws2_32 -mwindows -o $@ && $(STRIP) $@
$(CXX) $(OBJS) icon.o $(LINK_FLAGS) -limm32 -lole32 -luuid -lwinspool -lws2_32 -mwindows -o $@

# --------------------------------------------------------------

Expand Down

0 comments on commit 233e8c1

Please sign in to comment.