Files
my-os-project2/Makefile

56 lines
1.2 KiB
Makefile

.PHONY: clean prepare cleanall iso hdd 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
if [ ! -e FastLZ/examples/6pack ] || [ ! -e FastLZ/examples/6unpack ]; then \
cd FastLZ/examples; \
make; \
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 disk.hdd base.img.lz77
base:
./scripts/mkbaseimg.sh
iso:
./scripts/mkiso.sh
hdd:
./scripts/mkhdd.sh