1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00
kernel/Makefile

91 lines
1.3 KiB
Makefile
Raw Normal View History

2017-11-04 02:51:56 -04:00
include config.mk
2017-11-04 02:09:14 -04:00
2017-11-08 04:38:55 -05:00
export AR = $(CCPREFIX)ar
export AS = $(CCPREFIX)as
export CC = $(CCPREFIX)gcc
2017-11-04 03:43:03 -04:00
export INCLUDE = $(shell pwd)/include
export KERNEL = $(shell pwd)/kernelmq.multiboot2
2017-11-04 03:43:03 -04:00
export LIBK = $(shell pwd)/libk/libk.a
2017-11-08 04:38:55 -05:00
export LIBARCH = $(shell pwd)/arch/$(ARCH)/libarch.a
export LINKER = $(shell pwd)/arch/$(ARCH)/linker.ld
2017-11-05 13:24:19 -05:00
export MODULES = $(addprefix $(shell pwd)/modules/, dummy1.bin dummy2.bin)
2017-11-04 03:43:03 -04:00
2017-11-08 06:11:31 -05:00
ifeq (none, $(ARCH))
run: test
else
2017-11-01 05:20:44 -04:00
run: run-iso
2017-11-08 06:11:31 -05:00
endif
2017-11-01 01:03:52 -04:00
2017-11-08 06:06:18 -05:00
all: all-kernel
2017-11-08 04:38:55 -05:00
clean: clean-kernel clean-iso clean-libk clean-arch clean-test clean-modules
2017-11-01 05:20:44 -04:00
2017-11-04 04:04:22 -04:00
test: run-test
2017-11-04 04:13:22 -04:00
##########
# Kernel #
##########
2017-11-08 04:38:55 -05:00
all-kernel: all-arch all-libk
$(CC) -T $(LINKER) -o $(KERNEL) -ffreestanding -nostdlib -lgcc $(LIBARCH) $(LIBK)
2017-11-01 00:43:42 -04:00
2017-11-01 05:20:44 -04:00
clean-kernel:
2017-11-08 04:38:55 -05:00
rm -f $(KERNEL)
########
# arch #
########
all-arch:
make all -C arch
clean-arch:
2017-11-08 03:58:02 -05:00
make clean -C arch
2017-11-01 05:20:44 -04:00
2017-11-04 04:13:22 -04:00
#######
# ISO #
#######
2017-11-04 04:04:22 -04:00
run-iso: all-iso
2017-11-04 03:43:03 -04:00
make run -C iso
2017-11-01 05:20:44 -04:00
2017-11-05 05:03:08 -05:00
all-iso: all-kernel all-modules
2017-11-04 03:43:03 -04:00
make all -C iso
2017-11-01 05:20:44 -04:00
clean-iso:
2017-11-01 23:38:06 -04:00
make clean -C iso
2017-11-04 02:04:04 -04:00
2017-11-04 04:13:22 -04:00
########
# libk #
########
2017-11-04 02:04:04 -04:00
all-libk:
make all -C libk
clean-libk:
make clean -C libk
2017-11-04 03:33:31 -04:00
2017-11-04 04:13:22 -04:00
#########
# Tests #
#########
2017-11-04 03:33:31 -04:00
2017-11-04 04:13:22 -04:00
run-test: all-test
make run -C test
2017-11-04 04:04:22 -04:00
all-test: all-libk
2017-11-04 04:13:22 -04:00
make all -C test
2017-11-04 04:04:22 -04:00
2017-11-04 03:33:31 -04:00
clean-test:
2017-11-04 04:13:22 -04:00
make clean -C test
2017-11-05 04:56:53 -05:00
###########
# Modules #
###########
all-modules:
make all -C modules
clean-modules:
make clean -C modules