-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 892 Bytes
/
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
CC=clang
CFLAGS=-Os -target i386-unknown-none-code16 -c
LINKER=ld
LDFLAGS=-m elf_i386
MOUNT=/mnt
-include config.mk
rect.com: com.ld rectangle.o dos.o graphics.o
$(LINKER) $(LDFLAGS) -o $@ --script=$< $(filter-out $<, $^)
gdc.com: com.ld rectangle-gdc.o dos.o gdc.o
$(LINKER) $(LDFLAGS) -o $@ --script=$< $(filter-out $<, $^)
com.ld: crt0.o
touch com.ld
crt0.o: crt0.s
$(CC) $(CFLAGS) -o $@ $<
rectangle.o: rectangle.c dos.h graphics.h
$(CC) $(CFLAGS) -o $@ $<
rectangle-gdc.o: rectangle-gdc.c dos.h gdc.h
$(CC) $(CFLAGS) -o $@ $<
dos.o: dos.c dos.h
$(CC) $(CFLAGS) -o $@ $<
graphics.o: graphics.c graphics.h
$(CC) $(CFLAGS) -o $@ $<
gdc.o: gdc.c gdc.h
$(CC) $(CFLAGS) -o $@ $<
.PHONY: clean
clean:
rm *.com *.o
.PHONY: install
install: rect.com gdc.com
cp rect.com $(MOUNT)
cp gdc.com $(MOUNT)
sync
.PHONY: format
format:
clang-format -i --style=Chromium *.c *.h