summaryrefslogtreecommitdiff
path: root/Source/Applications/SampleApps/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Applications/SampleApps/Makefile')
-rw-r--r--Source/Applications/SampleApps/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/Applications/SampleApps/Makefile b/Source/Applications/SampleApps/Makefile
new file mode 100644
index 0000000..a632f87
--- /dev/null
+++ b/Source/Applications/SampleApps/Makefile
@@ -0,0 +1,37 @@
+.PHONY: clean, mrproper
+
+ASM = nasm
+ASMFLAGS = -f elf
+
+CXX = g++
+CXXFLAGS = -nostartfiles -nostdlib -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
+
+Applications = asmdemo cxxdemo
+
+all: $(Applications)
+ echo "* Done with applications : $(Applications)"
+
+rebuild: mrproper all
+
+%: %.cpp
+ echo "* Compiling $<..."
+ $(CXX) $(CXXFLAGS) -c $< -o $@.o
+ echo "* Linking $@.o..."
+ $(LD) $(LDFLAGS) ../../Library/Melon.o $@.o -o $@
+
+%: %.asm
+ echo "* Compiling $<..."
+ $(ASM) $(ASMFLAGS) -o $@.o $<
+ echo "* Linking $@.o..."
+ $(LD) $(LDFLAGS) $@.o -o $@
+
+clean:
+ echo "* Removing object files..."
+ rm -rf *.o
+
+mrproper: clean
+ echo "* Removing applications..."
+ rm -rf $(Applications)