diff --git a/Makefile b/Makefile index a8cce14..f2f3742 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,16 @@ +UNAME := $(shell uname) +ifeq ($(UNAME), Darwin) + STAT := gstat +else + STAT := stat +endif + all: tetros.img tetros.img: tetros.asm Makefile nasm -d DEBUG -f bin tetros.asm -o tetros.img - @echo "size is" `stat -c "%s" tetros.img` - @if [ `stat -c "%s" tetros.img` -gt 446 ]; then \ + @echo "size is" `$(STAT) -c "%s" tetros.img` + @if [ `$(STAT) -c "%s" tetros.img` -gt 446 ]; then \ bash -c 'echo -e "\e[91mOutput exceeded size of 446 bytes.\e[0m"'; \ rm -f tetros.img; exit 1; fi nasm -f bin tetros.asm -o tetros.img diff --git a/README.md b/README.md index dd7253d..5b8878f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ After that you should be able to boot the stick to play TetrOS. ## Compiling the sources -The repository already contains an image which you can use for testing. However, if you want to compile the image from the sources you need nasm, a general prupose x86 assembler to be installed on your system. On Ubuntu you can can install it via the command `sudo apt-get install nasm`. +The repository already contains an image which you can use for testing. However, if you want to compile the image from the sources you need nasm, a general prupose x86 assembler to be installed on your system. On Ubuntu you can can install it via the command `sudo apt-get install nasm`. On macOS you will need [homebrew](http://brew.sh/) to install `nasm` and `binutils`. If `nasm` is installed you can compile the sources by executing `make`. This will create the image `tetros.img`. After that you can run the image via qemu or you can copy the image via `dd` on an USB disk or a disk (see above).