SDL-1.2: Make it possible to run "make dist" from a separate build directory

From 0390f1c8dbd0ae076f49007a80d1c288b23e0162 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 24 Feb 2021 21:40:35 +0300
Subject: [PATCH] Make it possible to run "make dist" from a separate build
 directory

(backported Sam's patch from SDL-2.0)
---
 Makefile.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 6da55515..eb396265 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -41,7 +41,8 @@ SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
 SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
 SDLMAIN_LDFLAGS = @SDLMAIN_LDFLAGS@
 
-DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.ac COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC os2 Makefile.os2 Watcom-Win32.zip symbian.zip WhatsNew Xcode
+SRC_DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.ac COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec.in src test TODO VisualCE VisualC.html VisualC os2 Makefile.os2 Watcom-Win32.zip symbian.zip WhatsNew Xcode
+GEN_DIST = SDL.spec
 
 HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
 
@@ -146,7 +147,8 @@ distclean: clean
 
 dist $(distfile):
 	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
-	tar cf - $(DIST) | (cd $(distdir); tar xf -)
+	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
+	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
 	cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
 	rm -rf $(distdir)/test/autom4te*
 	find $(distdir) \( \