diff --git a/Make/SuggestFileTypes b/Make/SuggestFileTypes deleted file mode 100644 index c9ae1a4..0000000 --- a/Make/SuggestFileTypes +++ /dev/null @@ -1,49 +0,0 @@ -# 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" - Else If "{UntypedFile}" =~ /ÅGoNativeResources/ - Set NewT "rsrc" - Set NewC "RSED" - End - - Echo " SetFile -t ¶"{NewT}¶" -c ¶"{NewC}¶" ¶"{UntypedFile}¶"" - - Set Count `Evaluate {Count} + 1` - End -End - -Echo "# Total: {Count}" diff --git a/Misc/SetFileTypes.sh b/Misc/SetFileTypes.sh new file mode 100644 index 0000000..0590c50 --- /dev/null +++ b/Misc/SetFileTypes.sh @@ -0,0 +1 @@ +cd "`dirname "$0"`"; cd ..; find . -type f -not -path '*/.*' -not -ipath './BuildResults/*' -not -ipath './Tools/*' -exec SetFile -t 'TEXT' -c 'MPS ' {} \;; find Tools -type f -not -path '*/.*' \( -ipath '*.c' -o -ipath '*.h' -o -ipath '*.make' \) -exec SetFile -t 'TEXT' -c 'MPS ' {} \;; find BuildResults -type f -not -path '*/.*' \( -ipath '*.o' -o -ipath '*.lib' \) -exec SetFile -t 'OBJ ' -c 'MPS ' {} \;; find . -type f -not -path '*/.*' \( -ipath '*.rsrc' -o -iname GoNativeResources \) -exec SetFile -t 'rsrc' -c 'RSED' {} \; \ No newline at end of file diff --git a/README.md b/README.md index 3fb82af..96442a1 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Append this to `.git/info/attributes`: * filter=maclines *.lib -filter *.o -filter + *.sh -filter .gitignore -filter Finally, do a once-off "re-smudge": @@ -25,6 +26,13 @@ Finally, do a once-off "re-smudge": rm -rf ../mac-rom/* git checkout . +Setting type and creator codes +------------------------------ + +Some MPW Tools require their input files to have the correct Mac OS file type ("TEXT" or "OBJ "), but Git does not save Mac OS type and creator codes. This shell script will correct the file types in a freshly cloned repo: + + sh Misc/SetFileTypes.sh + Building -------- This code is built with the [Macintosh Programmer's Workshop](https://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Workshop) (MPW), which runs on the Classic Mac OS. To satisfy the memory requirements of the build process, the MPW Shell should get a memory partition of at least 16 MB. Once you have MPW set up, the build process is not particularly fussy.