From: Timo Korvola Date: Tue, 27 Mar 2018 20:19:12 +0000 (+0300) Subject: Don't leak curses sound options elsewhere. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=ffc49e88a3dc3642175e4b13717dce10d796b799;p=liskon_frotz.git Don't leak curses sound options elsewhere. --- diff --git a/Makefile b/Makefile index 0c330d0..8d5ce0d 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ RANLIB ?= $(shell which ranlib) # Choose your sound support # OPTIONS: ao, none -SOUND ?= ao +export SOUND ?= ao # Default sample rate for sound effects. # All modern sound interfaces can be expected to support 44100 Hz sample @@ -71,14 +71,8 @@ BUFFSIZE ?= 4096 DEFAULT_CONVERTER ?= SRC_SINC_MEDIUM_QUALITY ifeq ($(SOUND), ao) - LDFLAGS += -lao -ldl -lpthread -lm -lsndfile -lvorbisfile -lmodplug -lsamplerate - CFLAGS += -pthread -else ifeq ($(SOUND), none) - CFLAGS += -DNO_SOUND -else ifndef SOUND - CFLAGS += -DNO_SOUND -else - @echo "Invalid sound choice $(SOUND)." + CURSES_LDFLAGS = -lao -ldl -lpthread -lm \ + -lsndfile -lvorbisfile -lmodplug -lsamplerate endif ########################################################################## @@ -158,7 +152,8 @@ $(SUB_CLEAN): # Main programs frotz: $(COMMON_LIB) $(CURSES_LIB) $(BLORB_LIB) $(COMMON_LIB) - $(CC) $(CFLAGS) $+ -o $@$(EXTENSION) $(CURSES) $(LDFLAGS) + $(CC) $(CFLAGS) $+ -o $@$(EXTENSION) $(CURSES) $(LDFLAGS) \ + $(CURSES_LDFLAGS) dfrotz: $(COMMON_LIB) $(DUMB_LIB) $(BLORB_LIB) $(COMMON_LIB) $(CC) $(CFLAGS) $+ -o $@$(EXTENSION) diff --git a/src/curses/Makefile b/src/curses/Makefile index 3ae1109..15edd12 100644 --- a/src/curses/Makefile +++ b/src/curses/Makefile @@ -11,6 +11,18 @@ TARGET = frotz_curses.a ARFLAGS = rc +SOUND ?= ao + +ifeq ($(SOUND), ao) + CFLAGS += -pthread +else ifeq ($(SOUND), none) + CFLAGS += -DNO_SOUND +else ifndef SOUND + CFLAGS += -DNO_SOUND +else + $(error Invalid sound choice $(SOUND)) +endif + .PHONY: clean .DELETE_ON_ERROR: