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
|
2017-11-08 06:21:03 -05:00
|
|
|
export KERNEL = $(shell pwd)/kernelmq
|
2017-11-08 06:34:14 -05:00
|
|
|
|
|
|
|
export LIBSRC = $(shell pwd)/src/libsrc.a
|
|
|
|
export LIBK = $(shell pwd)/libk/libk.a
|
|
|
|
|
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:34:14 -05:00
|
|
|
export CFLAGS = -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I $(INCLUDE)
|
|
|
|
|
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 07:02:36 -05:00
|
|
|
all-kernel: all-arch
|
2017-11-08 07:09:14 -05:00
|
|
|
cp arch/$(ARCH)/kernelmq $(KERNEL)
|
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)
|
|
|
|
|
2017-11-08 06:34:14 -05:00
|
|
|
#######
|
|
|
|
# src #
|
|
|
|
#######
|
|
|
|
|
|
|
|
all-src:
|
|
|
|
make all -C src
|
|
|
|
|
|
|
|
clean-src:
|
|
|
|
make clean -C src
|
|
|
|
|
2017-11-08 04:38:55 -05:00
|
|
|
########
|
|
|
|
# arch #
|
|
|
|
########
|
|
|
|
|
2017-11-08 07:02:36 -05:00
|
|
|
all-arch: all-src all-libk
|
2017-11-08 04:38:55 -05:00
|
|
|
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
|