From 7f073028a36dd95c3fec9e8e48b0946bee093e6b Mon Sep 17 00:00:00 2001 From: David Griffith Date: Thu, 26 Jul 2018 15:35:57 -0700 Subject: [PATCH] Add header guards and fix duplicated defines for compiling with no sound. --- Makefile | 7 ++++++- src/curses/Makefile | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 995af00..e20ed51 100644 --- a/Makefile +++ b/Makefile @@ -194,7 +194,9 @@ $(COMMON_DEFINES): curses_defines: $(CURSES_DEFINES) $(CURSES_DEFINES): @echo "Generating $@" - @echo "#define CONFIG_DIR \"$(SYSCONFDIR)\"" > $@ + @echo "#ifndef CURSES_DEFINES_H" > $@ + @echo "#define CURSES_DEFINES_H" >> $@ + @echo "#define CONFIG_DIR \"$(SYSCONFDIR)\"" >> $@ @echo "#define SOUND \"$(SOUND)\"" >> $@ @echo "#define SAMPLERATE $(SAMPLERATE)" >> $@ @echo "#define BUFFSIZE $(BUFFSIZE)" >> $@ @@ -216,6 +218,9 @@ ifdef NO_MEMMOVE @echo "#define NO_MEMMOVE" >> $@ endif + @echo "#endif /* CURSES_DEFINES_H */" >> $@ + + hash: $(HASH) $(HASH): @echo "Creating $@" diff --git a/src/curses/Makefile b/src/curses/Makefile index 15edd12..136f412 100644 --- a/src/curses/Makefile +++ b/src/curses/Makefile @@ -16,9 +16,9 @@ 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 -- 2.34.1