summaryrefslogtreecommitdiff
path: root/euler/makefile
blob: b9d440f726b0790adeb0486135996c26d72b4f37 (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
LIBSTDCPP_SOURCES = euler/stream.cpp strings/strlen.cpp euler/syscall.asm \
  euler/entry.cpp io/fopen.cpp euler/gcc.asm memory/delete.cpp euler/heap.cpp \
  memory/new.cpp io/fclose.cpp io/fread.cpp strings/memcpy.cpp io/fseek.cpp

clean:
	rm -rf build

build/%.asm.o: source/%.asm
	@mkdir -p $(@D)
	$(HILBERT_NASM) $^ -o $@

build/%.cpp.o: source/%.cpp
	@mkdir -p $(@D)
	$(HILBERT_CC) -c $^ -o $@

build/crt0.o: build/empty.asm.o
	cp $^ $@

build/libc.a: build/empty.asm.o
	$(HILBERT_AR) rcs $@ $^

build/libg.a: build/empty.asm.o
	$(HILBERT_AR) rcs $@ $^

build/libm.a: build/empty.asm.o
	$(HILBERT_AR) rcs $@ $^

build/libstdc++.a: ${LIBSTDCPP_SOURCES:%=build/%.o}
	$(HILBERT_AR) rcs $@ $^