From 224b1d00e0070528d8ad1fcc55d596c1f75e4622 Mon Sep 17 00:00:00 2001
From: Ben Avison <bavison@riscosopen.org>
Date: Wed, 7 Oct 2020 20:55:14 +0100
Subject: [PATCH] Rewrite makefile to use shared makefiles

Also strip dependencies in `!MkClean` now that we create some, and set up
`.gitignore` appropriately.

Requires RiscOS/BuildSys!32
---
 !MkClean,fd7     |  1 +
 .gitignore       |  5 +++++
 bas/Keep => Keep |  0
 Makefile         | 49 ++++--------------------------------------------
 4 files changed, 10 insertions(+), 45 deletions(-)
 create mode 100644 .gitignore
 rename bas/Keep => Keep (100%)

diff --git a/!MkClean,fd7 b/!MkClean,fd7
index 5627679..aa5e15c 100644
--- a/!MkClean,fd7
+++ b/!MkClean,fd7
@@ -14,3 +14,4 @@
 |
 Dir <Obey$Dir>
 amu_machine clean
+stripdepnd
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cb77461
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/Squish,ffb
+/crunched/
+/Makefile.d
+/o/
+/objs/
diff --git a/bas/Keep b/Keep
similarity index 100%
rename from bas/Keep
rename to Keep
diff --git a/Makefile b/Makefile
index b55eed0..29c5a4c 100644
--- a/Makefile
+++ b/Makefile
@@ -13,52 +13,11 @@
 # limitations under the License.
 #
 # Makefile for Squish
-#
-
-#
-# Program specific options:
-#
-COMPONENT  = Squish
-MSGVERSION = ${AWK} -f Build:AwkVers
-
-include StdTools
-
-SQFLAGS = -nolist
-
-FILES  =\
- squished.${COMPONENT}
-
-#
-# Generic build rules:
-#
-all: ${FILES}
-	@${ECHO} ${COMPONENT}: all build complete
-
-install: ${FILES}
-	 ${CP} squished.${COMPONENT} ${INSTDIR}.${COMPONENT} ${CPFLAGS}
-	 @${ECHO} ${COMPONENT}: installed
-
-clean:
-	${XWIPE} squished ${WFLAGS}
-	${XWIPE} crunched ${WFLAGS}
-	${XWIPE} n ${WFLAGS}
-	@${ECHO} ${COMPONENT}: cleaned
-
-#
-# Static dependencies:
-#
-	             
-squished.${COMPONENT}: crunched.${COMPONENT} bas.Keep
-	${MKDIR} squished
-	${SQUISH} ${SQFLAGS} -keep bas.Keep -from crunched.${COMPONENT} -to $@
 
-crunched.${COMPONENT}: n.${COMPONENT}
-	${MKDIR} crunched
-	crunch.${COMPONENT}; BASIC
+COMPONENT         ?= Squish
+SQUISHFLAGS        = -keep Keep
+SOURCES_TO_SYMLINK = Keep
 
-n.${COMPONENT}: bas.${COMPONENT}
-	${MKDIR} n
-	${NUMBER} bas.${COMPONENT} $@
+include BasicApp
 
-#---------------------------------------------------------------------------
 # Dynamic dependencies:
-- 
GitLab