os-k/Makefile

64 lines
2.8 KiB
Makefile

#=----------------------------------------------------------------------------=#
# GNU GPL OS/K #
# #
# Desc: Project Makefile #
# #
# #
# Copyright © 2018-2019 The OS/K Team #
# #
# This file is part of OS/K. #
# #
# OS/K is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# any later version. #
# #
# OS/K is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY# without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with OS/K. If not, see <https://www.gnu.org/licenses/>. #
#=----------------------------------------------------------------------------=#
kernel:
cpp ./Makefile.in > build/Makefile.out
python ./build/idttool.py
make kernel -f build/Makefile.out.2
rm build/Makefile.out build/Makefile.out.2
kernel-asm:
cpp -D_TO_ASM ./Makefile.in > build/Makefile.out
python ./build/idttool.py
make kernel -f build/Makefile.out.2
rm build/Makefile.out build/Makefile.out.2
tests:
cpp -D_TESTS ./Makefile.in > build/Makefile.out
python ./build/idttool.py
make tests -f build/Makefile.out.2
rm build/Makefile.out build/Makefile.out.2
ASM=nasm
ASMFLAGS=
BOOTFLAGS=-f bin
MBRDIR=boot/mbr
LOADERDIR=boot/loader
OBJDIR=build/obj
BINDIR=build/bin
boot.mbr.asm: $(MBRDIR)/mbr.asm $(MBRDIR)/mbr.inc
$(ASM) $(BOOTFLAGS) $(MBRDIR)/mbr.asm -o $(OBJDIR)/boot/mbr.bin
boot.loader.asm: $(LOADERDIR)/loader.asm
$(ASM) $(BOOTFLAGS) $(LOADERDIR)/loader.asm -o $(OBJDIR)/boot/loader.bin
bootloader: boot.mbr.asm boot.loader.asm
cp $(OBJDIR)/boot/mbr.bin $(BINDIR)/mbr.bin
cp $(OBJDIR)/boot/loader.bin $(BINDIR)/loader.bin
all: bootloader kernel