summaryrefslogtreecommitdiff
path: root/Source/Applications/SampleApps/Makefile
blob: d45011e6587b36baaef892e211049149bea2f73c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 = --entry=start -Ttext=40000000

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)