2015-08-14 11:34:14 +00:00
|
|
|
|
# Makefile generated by makedep.
|
|
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
|
RM = rm
|
|
|
|
|
AS = gcc
|
|
|
|
|
CC = gcc
|
|
|
|
|
CXX = g++
|
|
|
|
|
LD = g++
|
|
|
|
|
LEX = flex
|
|
|
|
|
YACC = bison
|
2015-10-07 22:29:11 +00:00
|
|
|
|
TEMPLE = mono temple.exe
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# File Lists
|
2015-08-14 21:53:51 +00:00
|
|
|
|
SRCS_AS = asm/dynamic.S asm/intr_common_handler.S asm/multiboot.S asm/start.S
|
2015-08-17 13:38:19 +00:00
|
|
|
|
SRCS_CC = src/console.c src/init.c src/interrupts.c src/malloc.c src/pmm.c src/serial.c src/stdlib.c src/timer.c src/vmm.c
|
2015-10-07 22:29:11 +00:00
|
|
|
|
SRCS_CXX = src/cplusplus.cpp src/cpp-test.cpp src/vm.cpp csl/cpustatetype.cpp
|
|
|
|
|
OBJS = obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# Flags
|
2015-10-07 11:16:15 +00:00
|
|
|
|
FLAGS = -m32 -DCIRCUIT_OS -Dnullptr=0 -D__cdecl="__attribute__((cdecl))" -mno-sse -mno-sse2 -mno-mmx -I/home/felix/projects/Electronics/Electronics/Conductance -I/home/felix/projects/Electronics/Electronics/Tools
|
2015-08-14 21:53:51 +00:00
|
|
|
|
ASFLAGS = -masm=intel
|
2015-08-14 11:34:14 +00:00
|
|
|
|
CCFLAGS = -g -std=c11 -Dnullptr=0 -Wall -g -fno-stack-protector -ffreestanding -Iinclude
|
2015-08-13 15:23:11 +00:00
|
|
|
|
CXXFLAGS = -g -std=c++11 -Wall -g -fno-stack-protector -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -fno-leading-underscore -Wall -Wextra -ffreestanding -Wno-unused-function -Iinclude
|
2015-10-07 01:43:23 +00:00
|
|
|
|
LDFLAGS = -g -m32 -nostdlib -fno-builtin -Tkernel.ld
|
2015-08-09 00:42:56 +00:00
|
|
|
|
|
2015-08-14 11:34:14 +00:00
|
|
|
|
# Targets
|
|
|
|
|
all: kernel
|
2015-08-09 00:42:56 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
2015-08-14 11:34:14 +00:00
|
|
|
|
clean:
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(RM) obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
2015-10-07 22:29:11 +00:00
|
|
|
|
kernel: obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
|
|
|
|
|
$(LD) $(FLAGS) $(LDFLAGS) -o $@ obj/dynamic.o obj/intr_common_handler.o obj/multiboot.o obj/start.o obj/console.o obj/init.o obj/interrupts.o obj/malloc.o obj/pmm.o obj/serial.o obj/stdlib.o obj/timer.o obj/vmm.o obj/cplusplus.o obj/cpp-test.o obj/vm.o obj/cpustatetype.o obj/main.o conductance/assembly.o conductance/compoundtype.o conductance/opcodes.o conductance/string.o conductance/virtualmachine.o conductance/vmpointertype.o conductance/vmprimitivetype.o conductance/vmtype.o conductance/vmvalue.o conductance/vmvoidtype.o
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/console.c
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/console.o: src/console.c include/console.h include/kstdlib.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/varargs.h include/config.h include/malloc.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/console.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/init.c
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/init.o: src/init.c include/kernel.h include/kstdlib.h include/varargs.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/config.h include/malloc.h include/console.h include/interrupts.h \
|
2015-08-17 13:38:19 +00:00
|
|
|
|
include/cpustate.h include/pmm.h include/multiboot.h include/vmm.h \
|
|
|
|
|
include/timer.h include/serial.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/init.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/interrupts.c
|
|
|
|
|
obj/interrupts.o: src/interrupts.c include/interrupts.h include/cpustate.h \
|
2015-10-07 01:43:23 +00:00
|
|
|
|
include/console.h include/kstdlib.h include/varargs.h include/config.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/malloc.h include/io.h src/intr_stubs.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/interrupts.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/malloc.c
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/malloc.o: src/malloc.c include/config.h include/kernel.h \
|
|
|
|
|
include/kstdlib.h include/varargs.h include/malloc.h include/console.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/serial.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/malloc.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/pmm.c
|
|
|
|
|
obj/pmm.o: src/pmm.c include/pmm.h include/multiboot.h include/kernel.h \
|
2015-10-07 01:43:23 +00:00
|
|
|
|
include/kstdlib.h include/varargs.h include/config.h include/malloc.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/console.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/pmm.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
2015-08-17 13:38:19 +00:00
|
|
|
|
# src/serial.c
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/serial.o: src/serial.c include/io.h include/serial.h include/kstdlib.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/varargs.h include/config.h include/malloc.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/serial.c
|
2015-08-17 13:38:19 +00:00
|
|
|
|
|
2015-08-14 11:34:14 +00:00
|
|
|
|
# src/stdlib.c
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/stdlib.o: src/stdlib.c include/kstdlib.h include/varargs.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/config.h include/malloc.h include/kernel.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/stdlib.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/timer.c
|
2015-08-15 22:45:12 +00:00
|
|
|
|
obj/timer.o: src/timer.c include/timer.h include/kernel.h \
|
|
|
|
|
include/interrupts.h include/cpustate.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/timer.c
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/vmm.c
|
2015-08-16 21:40:34 +00:00
|
|
|
|
obj/vmm.o: src/vmm.c include/config.h include/vmm.h include/pmm.h \
|
2015-10-07 01:43:23 +00:00
|
|
|
|
include/multiboot.h include/kstdlib.h include/varargs.h include/malloc.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/console.h include/kernel.h
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CC) -iquoteobj $(FLAGS) $(CCFLAGS) -o $@ -c src/vmm.c
|
2015-08-20 15:28:41 +00:00
|
|
|
|
|
2015-08-14 11:34:14 +00:00
|
|
|
|
# src/cplusplus.cpp
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/cplusplus.o: src/cplusplus.cpp include/kstdlib.h include/varargs.h \
|
2015-08-17 18:04:14 +00:00
|
|
|
|
include/config.h include/malloc.h include/console.h include/ker/new.hpp
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/cplusplus.cpp
|
2015-10-06 13:23:15 +00:00
|
|
|
|
|
|
|
|
|
# src/cpp-test.cpp
|
|
|
|
|
obj/cpp-test.o: src/cpp-test.cpp include/console.h include/ker/string.hpp \
|
2015-10-07 01:43:23 +00:00
|
|
|
|
include/ker/vector.hpp include/ker/dictionary.hpp include/kernel.h \
|
|
|
|
|
include/ker/pair.hpp
|
2015-10-07 22:29:11 +00:00
|
|
|
|
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/cpp-test.cpp
|
2015-08-14 11:34:14 +00:00
|
|
|
|
|
|
|
|
|
# src/vm.cpp
|
2015-10-07 01:43:23 +00:00
|
|
|
|
obj/vm.o: src/vm.cpp include/kstdlib.h include/varargs.h include/config.h \
|
2015-10-07 19:27:38 +00:00
|
|
|
|
include/malloc.h include/timer.h include/dynamic.h include/console.h \
|
2015-10-07 22:29:11 +00:00
|
|
|
|
include/interrupts.h include/cpustate.h src/../csl/cpustatetype.hpp
|
|
|
|
|
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c src/vm.cpp
|
|
|
|
|
|
|
|
|
|
# csl/cpustatetype.cpp
|
|
|
|
|
obj/cpustatetype.o: csl/cpustatetype.cpp csl/cpustatetype.hpp \
|
|
|
|
|
include/cpustate.h include/console.h
|
|
|
|
|
$(CXX) -iquoteobj $(FLAGS) $(CXXFLAGS) -o $@ -c csl/cpustatetype.cpp
|
2015-08-20 15:28:41 +00:00
|
|
|
|
|
2015-08-14 21:53:51 +00:00
|
|
|
|
# asm/dynamic.S
|
|
|
|
|
obj/dynamic.o: asm/dynamic.S
|
|
|
|
|
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/dynamic.S
|
|
|
|
|
|
2015-08-14 11:34:14 +00:00
|
|
|
|
# asm/intr_common_handler.S
|
|
|
|
|
obj/intr_common_handler.o: asm/intr_common_handler.S
|
|
|
|
|
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/intr_common_handler.S
|
|
|
|
|
|
|
|
|
|
# asm/multiboot.S
|
|
|
|
|
obj/multiboot.o: asm/multiboot.S
|
|
|
|
|
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/multiboot.S
|
|
|
|
|
|
|
|
|
|
# asm/start.S
|
|
|
|
|
obj/start.o: asm/start.S
|
|
|
|
|
$(AS) $(FLAGS) $(ASFLAGS) -o $@ -c asm/start.S
|
|
|
|
|
|
|
|
|
|
# Custom Targets
|
2015-10-07 01:43:23 +00:00
|
|
|
|
|
2015-10-07 11:45:07 +00:00
|
|
|
|
obj/main.o: scripts/main.spark
|
2015-10-07 22:29:11 +00:00
|
|
|
|
/home/felix/projects/Electronics/build-Electronics-Clang-Debug/bin/spark \
|
2015-10-07 11:45:07 +00:00
|
|
|
|
scripts/main.spark \
|
|
|
|
|
obj/main.ca
|
2015-08-14 13:38:01 +00:00
|
|
|
|
objcopy -B i386 -I binary -O elf32-i386 \
|
2015-10-07 11:45:07 +00:00
|
|
|
|
obj/main.ca obj/main.o
|
2015-08-14 13:38:01 +00:00
|
|
|
|
objcopy \
|
2015-10-07 11:45:07 +00:00
|
|
|
|
--redefine-sym _binary_obj_main_ca_start=mainscript_start \
|
|
|
|
|
--redefine-sym _binary_obj_main_ca_end=mainscript_end \
|
|
|
|
|
--redefine-sym _binary_obj_main_ca_size=mainscript_size \
|
2015-08-14 13:38:01 +00:00
|
|
|
|
obj/main.o
|
|
|
|
|
|
2015-08-09 00:42:56 +00:00
|
|
|
|
.PHONY: run
|
2015-08-14 11:34:14 +00:00
|
|
|
|
run:
|
2015-08-17 13:38:19 +00:00
|
|
|
|
qemu-system-i386 -serial stdio -kernel kernel
|
2015-08-17 18:04:14 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: debug
|
|
|
|
|
debug:
|
|
|
|
|
qemu-system-i386 -s -S -serial stdio -kernel kernel
|