From: David Griffith Date: Thu, 26 Jul 2018 22:35:57 +0000 (-0700) Subject: Add header guards and fix duplicated defines for compiling with no sound. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=7f073028a36dd95c3fec9e8e48b0946bee093e6b;p=liskon_frotz.git Add header guards and fix duplicated defines for compiling with no sound. --- 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