summaryrefslogtreecommitdiff
path: root/Source/Applications/Demos/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Applications/Demos/Makefile')
-rw-r--r--Source/Applications/Demos/Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/Applications/Demos/Makefile b/Source/Applications/Demos/Makefile
new file mode 100644
index 0000000..e66acce
--- /dev/null
+++ b/Source/Applications/Demos/Makefile
@@ -0,0 +1,35 @@
+.PHONY: clean, mrproper
+
+ASM = nasm
+ASMFLAGS = -f bin
+
+CXX = g++
+CXXFLAGS = -nostartfiles -nostdlib -ffreestanding -fno-exceptions -fno-rtti -I ../../Library/Common -I ../../Library/Interface -I ../../Library/Userland -D THIS_IS_MELON_USERLAND
+
+LD = ld
+LDFLAGS = -T ../../Library/Link.ld -L ../../Library
+
+Applications = asmdemo cxxdemo GOL
+
+all: $(Applications)
+ echo "* Done with applications : $(Applications)"
+
+rebuild: mrproper all
+
+%: %.cpp
+ echo "* Compiling $<..."
+ $(CXX) $(CXXFLAGS) -c $< -o $@.o
+ echo "* Linking $@.o..."
+ $(LD) $(LDFLAGS) $@.o -o $@
+
+%: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(ASMFLAGS) -o $@ $<
+
+clean:
+ echo "* Removing object files..."
+ rm -rf *.o
+
+mrproper: clean
+ echo "* Removing applications..."
+ rm -rf $(Applications)