]> granicus.if.org Git - nethack/commitdiff
Unix Makefiles
authorPatR <rankin@nethack.org>
Wed, 8 Feb 2023 19:38:47 +0000 (11:38 -0800)
committerPatR <rankin@nethack.org>
Wed, 8 Feb 2023 19:38:47 +0000 (11:38 -0800)
Move building uudecode for unpacking .Wav files from Makefile.dat to
Makefile.utl and add uudecode to util's 'make spotless'.

sys/unix/Makefile.utl
sys/unix/hints/include/multisnd-post.370

index 6c9cfb3eef115cfde50f99e97761cbc9320ce166..13a2bbe9c513471cbca61c4b31ee2c29b97bc220 100644 (file)
@@ -354,6 +354,11 @@ tileedit: tileedit.o $(TEXT_IO)
        $(QTDIR)/bin/moc -o tileedit.moc tileedit.h
        $(CXXLINK) -o tileedit -L$(QTDIR)/lib tileedit.o $(TEXT_IO) -lqt
 
+uudecode: uudecode.o
+       $(CLINK) $(LFLAGS) -o uudecode uudecode.o $(LIBS)
+uudecode.o: ../sys/share/uudecode.c
+       $(CC) $(CFLAGS) -c -o uudecode.o ../sys/share/uudecode.c
+
 # using dependencies like
 #      ../src/foo::
 #              @( cd ../src ; $(MAKE) foo )
@@ -408,4 +413,4 @@ clean:
 spotless: clean
        -rm -f makedefs recover dlb
        -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \
-               tilemap tileedit tile2bmp
+               tilemap tileedit tile2bmp uudecode
index 114f5c40c28e5d02402e01626cec5063657aede6..431745dab5d86f4fd3ad4ca872ee1a0fefea2f09 100644 (file)
@@ -2,18 +2,22 @@
 # NetHack 3.7  multisnd-post.370 $NHDT-Date: 1597332785 2020/08/13 15:33:05 $  $NHDT-Branch: NetHack-3.7 $
 
 ifeq "$(HAVE_SNDLIB)" "1"
+# note:        one possible value for $(SNDLIBSRC) is 'macsound.m' which is written
+#      in Objective-C; this relies on $(CC) recognizing the filename suffix
+#      and knowing how to handle that; clang on MacOS does, both when
+#      masquerading as gcc and when invoked as itself
 $(TARGETPFX)$(SNDLIBOBJ): $(SNDLIBSRC) $(HACK_H)
-       $(CC) $(CFLAGS) -c -o$@ $(SNDLIBSRC)
+       $(CC) $(CFLAGS) -c -o $@ $(SNDLIBSRC)
+
 ifeq "$(NEEDS_WAV)" "1"
+
 $(WAVDIR)/%.wav: ../util/uudecode $(WAVDIR)/%.uu
        $^
        mv $(notdir $@) $@
 
-../util/uudecode: uudecode.o
-       $(CC) $(LFLAGS) uudecode.o -o $@
+../util/uudecode: ../sys/share/uudecode.c
+       ( cd ../util ; $(MAKE) uudecode )
 
-uudecode.o: ../sys/share/uudecode.c
-       $(CC) $(CFLAGS) -c -o $@ ../sys/share/uudecode.c
 endif  # NEEDS_WAV
 endif  # HAVE_SNDLIB