summaryrefslogtreecommitdiff
path: root/Source/Kernel/Makefile
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-08-21 21:16:48 +0200
committerAlexis211 <alexis211@gmail.com>2009-08-21 21:16:48 +0200
commitae803baa4e0ec584c7afd3f6d55f2e6b32010b46 (patch)
treea8d39cdeff28d2ce08ff7485736fef8119669547 /Source/Kernel/Makefile
parentf93a269f41659d9a33ea6f24411ca691978986cf (diff)
downloadMelon-ae803baa4e0ec584c7afd3f6d55f2e6b32010b46.tar.gz
Melon-ae803baa4e0ec584c7afd3f6d55f2e6b32010b46.zip
System boots up and shows a nice ASCII art logo.
Diffstat (limited to 'Source/Kernel/Makefile')
-rw-r--r--Source/Kernel/Makefile50
1 files changed, 50 insertions, 0 deletions
diff --git a/Source/Kernel/Makefile b/Source/Kernel/Makefile
new file mode 100644
index 0000000..3cc45cc
--- /dev/null
+++ b/Source/Kernel/Makefile
@@ -0,0 +1,50 @@
+.PHONY: clean, mrproper
+
+CC = gcc
+CXX = g++
+LD = ld
+LDFLAGS = -T Link.ld -Map Map.txt --oformat=elf32-i386
+CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -Werror
+CXXFLAGS = -nostartfiles -nostdlib -fno-rtti -fno-exceptions -I . -Wall -Werror -Wno-write-strings
+ASM = nasm
+ASMFLAGS = -f elf
+
+OutFile = Melon.ke
+Objects = Core/kmain.wtf.o \
+ Core/loader.wtf.o \
+ Core/cppsupport.wtf.o \
+ Core/Sys.ns.o \
+ Core/CMem.ns.o \
+ DisplayManager/Disp.ns.o \
+ Devices/Display/VGATextOutput.class.o
+
+all: $(OutFile)
+ echo "* Done with $(OutFile)."
+
+rebuild: mrproper all
+
+$(OutFile): $(Objects)
+ echo "* Linking executable : $(OutFile)..."
+ $(LD) $(LDFLAGS) -o $(OutFile) $^
+
+%.o: %.c
+ echo "* Compiling $<..."
+ $(CC) -c $< -o $@ $(CFLAGS)
+
+%.o: %.cpp
+ echo "* Compiling $<..."
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+%.o: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(ASMFLAGS) -o $@ $<
+
+clean:
+ echo "* Removing object files..."
+ rm -rf *.o
+ rm -rf */*.o
+ rm -rf */*/*.o
+
+mrproper: clean
+ echo "* Removing executable : $(OutFile)"
+ rm -rf $(OutFile)