-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
69 lines (62 loc) · 1.25 KB
/
Makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
TARGET = dax86
OBJS = \
main.o\
emulator.o\
emulator_functions.o\
instructions.o\
modrm.o\
io.o\
shift.o\
gdt.o\
paging.o\
twos_complement.o\
lapic.o\
ioapic.o\
interrupt.o\
kbd.o\
disk.o\
mp.o\
util.o\
instructions_00.o\
instructions_10.o\
instructions_20.o\
instructions_30.o\
instructions_40.o\
instructions_50.o\
instructions_60.o\
instructions_70.o\
instructions_80.o\
instructions_90.o\
instructions_A0.o\
instructions_B0.o\
instructions_C0.o\
instructions_D0.o\
instructions_E0.o\
instructions_F0.o\
instructions_0F00.o\
instructions_0F20.o\
instructions_0F80.o\
instructions_0F90.o\
instructions_0FB0.o
CC = /usr/bin/gcc
CFLAGS += -Wall
.PHONY: all create-docker clean-docker
all :
make $(TARGET)
# Dependencies
# gcc -c: only compile & assembly to .o
# $<: first prerequisite
%.o : %.c Makefile
$(CC) $(CFLAGS) -c $<
$(TARGET) : $(OBJS) Makefile
$(CC) -o $@ $(OBJS) -lm -lpthread
clean:
rm -f *.o
create-docker:
docker build -t dax86 .
docker run -dit -v $$(pwd):/dax86 --name dax86-c $$(docker images -q dax86)
docker exec -it $$(docker ps -aqf "name=dax86-c") bash
clean-docker:
docker stop $$(docker ps -aqf "name=dax86-c")
docker rm $$(docker ps -aqf "name=dax86-c")
docker image rm $$(docker images -q dax86)