summaryrefslogtreecommitdiff
path: root/Source/Library/Makefile
blob: 4a8d4eaad84914505207cbf38af9a19544c73726 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.PHONY: clean, mrproper

CXX = i586-elf-g++
CXXFLAGS = -nostartfiles -nostdlib -ffreestanding -fno-exceptions -fno-rtti -I Common -I Userland -I Interface -D THIS_IS_MELON_USERLAND -D RANDOM_SEED=1`date +%N`LL

ASM = nasm
ASMFLAGS = -f elf

LD = i586-elf-ld

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 \
		  Common/TextFile.class.uo \
		  Common/ByteArray.class.uo \
		  Common/Rand.ns.uo \
		  Common/OStream.proto.uo \
		  Common/IStream.proto.uo \
		  Common/FileStream.class.uo \
		  Common/StringStream.class.uo \
		  Common/cppsupport.wtf.uo \
		  Userland/App/ShellApp.proto.uo \
		  Userland/App/StreamApp.proto.uo \
		  Userland/Syscall/Syscall.wtf.uo \
		  Userland/Syscall/RessourceCaller.class.uo \
		  Userland/Start.uo

all: libMelon.o
	echo "* Done with library"

rebuild: mrproper all

libMelon.o: $(Objects)
	echo "* Linking static Melon library libMelon.o..."
	$(LD) -r $^ -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)