summaryrefslogtreecommitdiff
path: root/Source/Library/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Makefile')
-rw-r--r--Source/Library/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/Library/Makefile b/Source/Library/Makefile
new file mode 100644
index 0000000..a4b9b6a
--- /dev/null
+++ b/Source/Library/Makefile
@@ -0,0 +1,46 @@
+.PHONY: clean, mrproper
+
+CXX = g++
+CXXFLAGS = -nostartfiles -nostdlib -fno-exceptions -fno-rtti -I Common -I Userland -I Interface -D THIS_IS_MELON_USERLAND
+
+ASM = nasm
+ASMFLAGS = -f elf
+
+LDFLAGS = -r
+LD = ld
+
+Library = Melon.o
+Objects = Common/WChar.class.uo \
+ Common/CMem.ns.uo \
+ Common/Mutex.class.uo \
+ Common/Heap.class.uo \
+ Common/Heap-index.class.uo \
+ Common/String.class.uo \
+ Userland/Syscall/Syscall.wtf.uo \
+ Userland/Syscall/RessourceCaller.class.uo \
+ Userland/Start.uo
+
+all: $(Library)
+ echo "* Done with library"
+
+rebuild: mrproper all
+
+$(Library): $(Objects)
+ echo "* Linking melon library $(Library)..."
+ $(LD) $(LDFLAGS) $^ -o $@
+
+%.uo: %.cpp
+ echo "* Compiling $<..."
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+%.uo: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(ASMFLAGS) $< -o $@
+
+clean:
+ echo "* Removing object files..."
+ rm -rf $(Objects)
+
+mrproper: clean
+ echo "* Removing library..."
+ rm -rf $(Library)