babbleberry / rpi4-osdev

Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4

Home Page:https://www.rpi4os.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with Makefile on Windows

kenyonbowers opened this issue · comments

Hello! I've been following your tutorial, but when I copied the Makefile.gcc.windows, I renamed it just Makefile so I can type "make". But when I did that,, if gave me this error. I don't know if I'm using the wrong version of GCC or not. I made sure I had the ARM version.
del kernel8.elf *.o *.img /bin/sh: line 1: del: command not found make: *** [Makefile:22: clean] Error 127 PS E:\Repos\KemyonOS\KemyonOS\KemyonOS>

Hi!

It looks like you're not using Windows since you're running /bin/sh...

"del" is a command in Windows command prompt, but not in WSL which is a Linux subsystem. make can't find it because the Linux equivalent is "rm".

If you're building on Linux you'll need to use the normal gcc Makefile. Does it make sense?

Thanks,
Adam

I'm using Windows 10. I'm also using VSC to write the code. Does that have anything to do with it?

Edit,
Worst case scenario I can use a Linux VM or my Raspberry Pi running Raspberry Pi OS

So it looks like VSC is shelling out to /bin/sh which won't find a "del" command that "clean" needs. You'll need to use "/bin/rm" instead.

Maybe try with the normal gcc Makefile first (without the .windows extension) before you get into editing the Makefile?

Thanks,
Adam

So, I tried Makefile.gcc and it didn't work. I also tried installing "gcc-arm-10.2-2020.11-mingw-w64-i686-aarch64-none-elf" so that it would match the Makefile.gcc.windows and but I still get
del kernel8.elf *.o *.img /bin/sh: line 1: del: command not found make: *** [Makefile:22: clean] Error 127

I get this error in both VSC, Powershell, and the Command Prompt.

Edit,
I downloaded it from here (https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads/10-2-2020-11)
Also I didn't set any environment variables so maybe I need to do that?

Sorry, I don't use VSC (never have) and so I'm not sure how to help. I've tested the Makefiles (both .gcc using WSL, and .gcc.windows) on my own Windows box using just the Arm compiler from the command line (no environment variables needed) and both build just fine. I have no idea why the "del" command seemingly can't be found on your box. This feels environmental, and so I'm sorry I can't really help :(