soundlib in the Makefile hints updated

Move pieces of the Makefile hints sound-related changes that
are not macOS-specific from sys/unix/hints/macOS.370 to some new
include files. The WANT_MACSOUND block stays in
sys/unix/hints/macOS.370 because it is system-specific.

Before this change, the various Makefiles were assembled via
hints files macOS.370 or linux.370. Both were using included
portions from the following files in the sys/unix/hints/include
directory, in this sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
    -INCLUDE gbdates-post.370
    -INCLUDE cross-post.370

After this change, the various Makefiles will still be assembled
via hints files macOS.370 or linux.370. They will continue to use
included portions from the following files in the
sys/unix/hints/include directory, but with three additional
include files related to sound and soundlibs. This is the new
sequence:

    -INCLUDE multiw-1.370
    -INCLUDE multiw-2.370
    -INCLUDE compiler.370
    -INCLUDE multiw-3.370
+   -INCLUDE multisnd1-pre.370
    -INCLUDE cross-pre.370
    -INCLUDE gbdates-pre.370
+   -INCLUDE multisnd2-pre.370
    -INCLUDE gbdates-post.370
+   -INCLUDE multisnd-post.370
    -INCLUDE cross-post.370

The include mechanism continues to allow common portions that can
be shared between macOS and Linux to be maintained in a single
place only, with minimal duplication. Now, that has been extended
to include Makefile lines related to sounds and soundlib.
This commit is contained in:
nhmall
2023-01-28 22:43:48 -05:00
parent 4575d564c7
commit 86368148bf
7 changed files with 140 additions and 63 deletions

View File

@@ -157,27 +157,27 @@ endif #MAKEFILE_SRC
ifdef WANT_MACSOUND
HAVE_SNDLIB = 1
SNDCFLAGS+= -DSND_LIB_MACSOUND -DSND_SOUNDEFFECTS_AUTOMAP
NEEDS_SND_USERSOUNDS = 1
NEEDS_SND_SEAUTOMAP = 1
NEEDS_WAV = 1
SNDCFLAGS+= -DSND_LIB_MACSOUND
SNDLIBSRC = ../sound/macsound/macsound.m
SNDLIBOBJ = macsound.o
LFLAGS += -framework AppKit
endif
# HAVE_SNDLIB could have been set just above, or it could
# have been set in multiw-2 for Qt. Either way, if it is
# set, add USER_SOUNDS
ifeq "$(HAVE_SNDLIB)" "1"
SNDCFLAGS+= -DUSER_SOUNDS
endif
#WINCFLAGS set from multiw-2.370
#SNDCFLAGS set from multiw-2.370
#
#-INCLUDE multisnd1-pre.370
#
# WINCFLAGS set from multiw-2.370
# SNDCFLAGS set from multisnd-pre.370
CFLAGS+= $(PKGCFLAGS) $(WINCFLAGS)
CFLAGS+= $(SNDCFLAGS)
CFLAGS+= $(NHCFLAGS)
#WINCFLAGS set from multiw-2.370
#SNDCFLAGS set from multiw-2.370
# WINCFLAGS set from multiw-2.370
# SNDCFLAGS set from multisnd-pre.370
CCXXFLAGS+= $(WINCFLAGS)
CCXXFLAGS+= $(SNDCFLAGS)
CCXXFLAGS+= $(NHCFLAGS)
@@ -392,49 +392,18 @@ VARDIR=$(HACKDIR)
#
#-INCLUDE gbdates-pre.370
#
ifdef WANT_MACSOUND
WAVDIR = ../sound/wav
SNDWAVS = se_squeak_A se_squeak_B se_squeak_B_flat se_squeak_C se_squeak_D \
se_squeak_D_flat se_squeak_E se_squeak_E_flat se_squeak_F \
se_squeak_F_sharp se_squeak_G se_squeak_G_sharp sound_Bell \
sound_Bugle_A sound_Bugle_B sound_Bugle_C sound_Bugle_D \
sound_Bugle_E sound_Bugle_F sound_Bugle_G \
sound_Drum_Of_Earthquake sound_Fire_Horn sound_Frost_Horn \
sound_Leather_Drum sound_Magic_Harp_A sound_Magic_Harp_B \
sound_Magic_Harp_C sound_Magic_Harp_D sound_Magic_Harp_E \
sound_Magic_Harp_F sound_Magic_Harp_G sound_Tooled_Horn_A \
sound_Tooled_Horn_B sound_Tooled_Horn_C sound_Tooled_Horn_D \
sound_Tooled_Horn_E sound_Tooled_Horn_F sound_Tooled_Horn_G \
sound_Wooden_Flute_A sound_Wooden_Flute_B sound_Wooden_Flute_C \
sound_Wooden_Flute_D sound_Wooden_Flute_E sound_Wooden_Flute_F \
sound_Wooden_Flute_G sound_Wooden_Harp_A sound_Wooden_Harp_B \
sound_Wooden_Harp_C sound_Wooden_Harp_D sound_Wooden_Harp_E \
sound_Wooden_Harp_F sound_Wooden_Harp_G sound_Magic_Flute_A \
sound_Magic_Flute_B sound_Magic_Flute_C sound_Magic_Flute_D \
sound_Magic_Flute_E sound_Magic_Flute_F sound_Magic_Flute_G
WAVS = $(addprefix $(WAVDIR)/, $(addsuffix .wav, $(SNDWAVS)))
endif
#
#-INCLUDE multisnd2-pre.370
#
#-POST
#
#-INCLUDE gbdates-post.370
#
ifdef WANT_MACSOUND
$(TARGETPFX)$(SNDLIBOBJ): $(SNDLIBSRC) $(HACK_H)
$(CC) $(CFLAGS) -c -o$@ $(SNDLIBSRC)
$(WAVDIR)/%.wav: ../util/uudecode $(WAVDIR)/%.uu
$^
mv $(notdir $@) $@
../util/uudecode: uudecode.o
$(CC) $(LFLAGS) uudecode.o -o $@
uudecode.o: ../sys/share/uudecode.c
$(CC) $(CFLAGS) -c -o $@ ../sys/share/uudecode.c
endif # WANT_MACSOUND
#
#-INCLUDE multisnd-post.370
#
ifdef WANT_LIBNH
$(TARGETPFX)libnh.a: $(HOBJ) $(LIBNHSYSOBJ) ../lib/lua/liblua.a
@@ -446,6 +415,10 @@ $(TARGETPFX)winshim.o : ../win/shim/winshim.c $(HACK_H)
$(CC) $(CFLAGS) -c -o$@ $<
endif # WANT_LIBNH
#
#-INCLUDE cross-post.370
#
ifdef MAKEFILE_TOP
###
### Packaging
@@ -628,5 +601,4 @@ endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP
#
#-INCLUDE cross-post.370
#