summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/Makefile
diff options
context:
space:
mode:
authorSamuel Bronson <naesten@gmail.com>2013-10-10 23:21:50 -0400
committerSamuel Bronson <naesten@gmail.com>2013-10-10 23:21:50 -0400
commit062f7eb415bf83ff65dd16cf75ec8d66c86d4895 (patch)
tree2483c8221248970cd51975654871f47f85eb1b9e /crawl-ref/source/Makefile
parent0784b6c54ccfef5dca7f0b2f068c14ed5df46506 (diff)
downloadcrawl-ref-062f7eb415bf83ff65dd16cf75ec8d66c86d4895.tar.gz
crawl-ref-062f7eb415bf83ff65dd16cf75ec8d66c86d4895.zip
Run dwz over the binary when available to save space
This almost cut my binary in half (something like 70MB -> 40MB). That's about 30MB less DWARF, and will probably make GDB happy.
Diffstat (limited to 'crawl-ref/source/Makefile')
-rw-r--r--crawl-ref/source/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
index a14a73eabf..b62031099d 100644
--- a/crawl-ref/source/Makefile
+++ b/crawl-ref/source/Makefile
@@ -998,6 +998,8 @@ ifeq ($(strip $(YACC)),)
NO_YACC = YesPlease
endif
+DWZ := $(shell which dwz 2> /dev/null)
+
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
QUIET_CC = @echo ' ' CC $@;
@@ -1392,6 +1394,9 @@ distclean: clean clean-contrib clean-rltiles
$(GAME): $(OBJECTS) $(EXTRA_OBJECTS) $(CONTRIB_LIBS) dat/dlua/tags.lua
+$(QUIET_LINK)$(CXX) $(LDFLAGS) $(EXTRA_OBJECTS) $(OBJECTS) -o $(GAME) $(LIBS)
+ifneq ($(DWZ),)
+ $(DWZ) --low-mem-die-limit 1 $(GAME)
+endif
debug: all
debug-lite: all