Skip to content

Commit 49f1436

Browse files
committed
Loot.
1 parent 7cbed32 commit 49f1436

7 files changed

Lines changed: 1101 additions & 141 deletions

File tree

www/notes/loot/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
UNAME := $(shell uname)
2+
.PHONY: test
3+
4+
ifeq ($(UNAME), Darwin)
5+
format=macho64
6+
else ifeq ($(UNAME), Linux)
7+
format=elf64
8+
else
9+
format=win64
10+
endif
11+
12+
%.run: %.o main.o char.o
13+
gcc main.o char.o $< -o $@
14+
15+
main.o: main.c types.h
16+
gcc -c main.c -o main.o
17+
18+
char.o: char.c types.h
19+
gcc -c char.c -o char.o
20+
21+
%.o: %.s
22+
nasm -f $(format) -o $@ $<
23+
24+
%.s: %.rkt
25+
racket -t compile-file.rkt -m $< > $@
26+
27+
clean:
28+
rm *.o *.s *.run
29+
30+
test: 42.run
31+
@test "$(shell ./42.run)" = "42"

0 commit comments

Comments
 (0)