Files
my-os-project2/Makefile
2025-09-20 20:07:39 +02:00

48 lines
997 B
Makefile

.PHONY: clean prepare cleanall iso base kernel user test
ARCH ?= x86_64
kernel:
make -C kernel ARCH=$(ARCH) ROOT=$(PWD) all
user:
make -C user ARCH=$(ARCH) ROOT=$(PWD) all
ulib:
make -C ulib ARCH=$(ARCH) ROOT=$(PWD) all
prepare:
if [ ! -d limine ]; then \
git clone https://github.com/limine-bootloader/limine.git --branch=v9.x-binary --depth=1; \
cd limine; \
make; \
fi
if [ ! -d toolchain/binutils-gdb ]; then \
cd toolchain; \
git clone git://sourceware.org/git/binutils-gdb.git --depth=1; \
$(PWD)/scripts/build-binutils-gdb.sh; \
cd ..; \
fi
if [ ! -d toolchain/gcc ]; then \
cd toolchain; \
git clone https://gcc.gnu.org/git/gcc.git --depth=1; \
$(PWD)/scripts/build-gcc.sh; \
cd ..; \
fi
cleanall:
make clean
rm -rf limine
clean:
make -C kernel ARCH=$(ARCH) ROOT=$(PWD) clean
make -C user ARCH=$(ARCH) ROOT=$(PWD) clean
make -C ulib ARCH=$(ARCH) ROOT=$(PWD) clean
rm -f mop2.iso base.img
base:
./scripts/mkbaseimg.sh
iso:
./scripts/mkiso.sh