Add header guards and fix duplicated defines for compiling with no sound.
authorDavid Griffith <dave@661.org>
Thu, 26 Jul 2018 22:35:57 +0000 (15:35 -0700)
committerDavid Griffith <dave@661.org>
Thu, 26 Jul 2018 22:35:57 +0000 (15:35 -0700)
Makefile
src/curses/Makefile

index 995af001090f77467cfd1cb7d84c0cb40172c0b6..e20ed519655b2c1977cbbb27cc91f6995a827c62 100644 (file)
--- 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 $@"
index 15edd120532c47ed007229d91e1c32e378a0cc5c..136f41294833c85197aa633b63273f1498a68b2c 100644 (file)
@@ -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