From 666baba34300009c01392357dd686ea29c067f00 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Wed, 20 Sep 2017 20:10:19 +0800 Subject: [PATCH] Add scripts to make a git-mangled repo buildable CreateBuildResultsFolders is necessary because git does not track empty directories (fair enough) despite the build system requiring their presence. SuggestFileTypes is necessary because git does not track Finder metadata. Both scripts are flexible in how they are run and robust -- important in a newly cloned repo. --- Make/CreateBuildResultsFolders | 36 ++++++++++++++++++++++++++ Make/SuggestFileTypes | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 Make/CreateBuildResultsFolders create mode 100644 Make/SuggestFileTypes diff --git a/Make/CreateBuildResultsFolders b/Make/CreateBuildResultsFolders new file mode 100644 index 0000000..2292fe1 --- /dev/null +++ b/Make/CreateBuildResultsFolders @@ -0,0 +1,36 @@ +# Takes no arguments -- expects to be inside the Make directory, +# or run in place (select all, then cmd-return) + +If "{0}" == "" + Set 0 "{Active}" +End + +Set BuildResults "`Files -f "{0}" | StreamEdit -e '1 Replace /[Â:]*:[Â:]*°/ -n'`" + +If {#} == 1 + Set BuildResults "{1}" +Else If {#} == 0 + Set MyPath "`Files -f "{0}"`" + Set BuildResults "`Echo "{MyPath}" | StreamEdit -e '1 Replace /[Â:]*:[Â:]*°/ -n'`" +Else + Echo "# USAGE: {0} [PATH]" + Exit 1 +End + +Set BuildResults "{BuildResults}BuildResults:" + +If "`Exists "{BuildResults}"`" == "" + NewFolder "{BuildResults}" +End + +For L1 in dbLite: LC930: RISC: ROM: + If "`Exists "{BuildResults}{L1}"`" == "" + NewFolder "{BuildResults}{L1}" + End + + For L2 in Image: Lib: Obj: Rsrc: Text: + If "`Exists "{BuildResults}{L1}{L2}"`" == "" + NewFolder "{BuildResults}{L1}{L2}" + End + End +End diff --git a/Make/SuggestFileTypes b/Make/SuggestFileTypes new file mode 100644 index 0000000..27233f2 --- /dev/null +++ b/Make/SuggestFileTypes @@ -0,0 +1,46 @@ +# Takes no arguments -- expects to be inside the Make directory, +# or run in place (select all, then cmd-return) + +If "{0}" == "" + Set 0 "{Active}" +End + +Set Tree "`Files -f "{0}" | StreamEdit -e '1 Replace /[Â:]*:[Â:]*°/ -n'`" + +If {#} == 1 + Set Tree "{1}" +Else If {#} == 0 + Set MyPath "`Files -f "{0}"`" + Set Tree "`Echo "{MyPath}" | StreamEdit -e '1 Replace /[Â:]*:[Â:]*°/ -n'`" +Else + Echo "# USAGE: {0} [PATH]" + Exit 1 +End + +Set Count 0 + +Echo "# Suggested commands:" + +For RootFolder in `Files -f "{Tree}" | StreamEdit -e '¥,° Replace /Å:.Å/ -n'` + For UntypedFile in `Files -f -r -o -s -t '' {RootFolder}` + Set NewT "TEXT" + Set NewC "MPS " + + If "{UntypedFile}" =~ /Å.x/ + Set NewT "XCOF" + Else If "{UntypedFile}" =~ /Å.o/ + Set NewT "OBJ " + Else If "{UntypedFile}" =~ /Å.lib/ + Set NewT "OBJ " + Else If "{UntypedFile}" =~ /Å.rsrc/ + Set NewT "rsrc" + Set NewC "RSED" + End + + Echo " SetFile -t ¶"{NewT}¶" -c ¶"{NewC}¶" ¶"{UntypedFile}¶"" + + Set Count `Evaluate {Count} + 1` + End +End + +Echo "# Total: {Count}"