summaryrefslogtreecommitdiff
path: root/kernel/Makefile
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2016-06-01 19:37:09 -0700
committerScott Gasch <[email protected]>2016-06-01 19:37:09 -0700
commit0a41dae5f406d498b5c9ab1542cb5660e0d982f6 (patch)
tree67ade9fe31cfd0458cc485e95550f7aaf14abdd1 /kernel/Makefile
Initial checkin of toy OS project.HEADmaster
Diffstat (limited to 'kernel/Makefile')
-rw-r--r--kernel/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
new file mode 100644
index 0000000..b5838d6
--- /dev/null
+++ b/kernel/Makefile
@@ -0,0 +1,30 @@
+DEBUGFLAGS=-DDEBUG
+
+SUBDIR += init
+SUBDIR += hal
+SUBDIR += rtl
+
+.include <bsd.port.subdir.mk>
+
+OBJCOPY= objcopy
+OBJCOPY_FLAGS= -R .dynamic -R .note -R .comment
+OBJS= init/entry.o init/main.o hal/video.o hal/io.o \
+ rtl/string.o rtl/memory.o hal/intsupport.o hal/interrupts.o \
+ hal/timer.o hal/keyboard.o hal/timestamp.o hal/counters.o
+RM= /bin/rm
+
+all: kernel.bin
+
+kernel.bin: kernel.tmp
+ $(OBJCOPY) $(OBJCOPY_FLAGS) -S -O binary ./kernel.tmp kernel.bin ; \
+ mcopy -o ./kernel.bin Q: ; \
+ mcopy -o ./kernel.map Q: ; \
+ $(RM) -f kernel.tmp
+
+kernel.tmp: $(OBJS)
+ $(LD) -M -o kernel.tmp -Ttext 0x00010000 -e StartOfKernelImage $(OBJS) \
+ > kernel.map
+
+clean:
+ $(RM) -f $(TARGET) $(OBJS) *~ #*# .#* ; \
+ mdel Q:\$(TARGET)