-
Notifications
You must be signed in to change notification settings - Fork 18
/
GNUmakefile
96 lines (77 loc) · 2.04 KB
/
GNUmakefile
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- makefile -*-
#
.PHONY: all clean dist.
KERNEL=eulex
all: $(KERNEL)
LINKER_SCRIPT = eulex.lds
CFLAGS = -fstrength-reduce -nostdinc -m32 -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -I. -ggdb
ASFLAGS = $(CFLAGS) -I.
DEPEND_FLAGS=-MM
LDFLAGS=-Wl,-T$(LINKER_SCRIPT)
FORTH_SRC= \
core.fs \
corestage2.fs \
vocabulary.fs \
exceptions.fs \
output.fs \
string.fs \
math.fs \
tools.fs \
disassem.fs \
structures.fs \
interpreter.fs \
kernel/multiboot.fs \
kernel/cpuid.fs \
kernel/video.fs \
kernel/console.fs \
colors.fs \
kernel/interrupts.fs \
kernel/exceptions.fs \
kernel/irq.fs \
kernel/timer.fs \
kernel/floppy.fs \
kernel/keyboard.fs \
kernel/speaker.fs \
kernel/serial.fs \
blocks.fs \
editor.fs \
debugger.fs \
linedit.fs \
input.fs \
memory.fs \
user.fs \
assembler.fs \
eulexrc.fs \
lisp/lisp.fs \
app/sokoban.fs
TESTING_SRC=tests/tests.fs \
tests/tsuite.fs \
tests/base.fs \
tests/strings.fs
LISP_SRC=lisp/core.lisp
ASM_SRC=boot.S forth.S
SOURCES=$(ASM_SRC)
HEADERS=multiboot.h
OBJS = $(ASM_SRC:.S=.o) $(FORTH_SRC:.fs=.o) $(TESTING_SRC:.fs=.o) $(LISP_SRC:.lisp=.o)
$(KERNEL): $(OBJS) $(LINKER_SCRIPT)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
clean:
-rm -f *.[do] kernel/*.[do] tests/*.[do] app/*.[do] lisp/*.[do] $(KERNEL) BUILTIN-FILES.S
%.d: %.S GNUmakefile
@$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $< > [email protected]; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < [email protected] > $@; \
rm -f [email protected]
%.o: %.fs
objcopy -I binary -O elf32-i386 -Bi386 $< $@
%.o: %.lisp
objcopy -I binary -O elf32-i386 -Bi386 $< $@
eulexrc.fs:
echo "( Write your personal definitions in this file )" > $@
forth.S: BUILTIN-FILES.S
BUILTIN-FILES.S: GNUmakefile
sh ./generate-builtin-files.sh $(FORTH_SRC) $(TESTING_SRC) $(LISP_SRC)
dist:
git archive --format=tar --prefix=eulex/ HEAD | gzip > eulex.tar.gz
# ifneq ($(MAKECMDGOALS),clean)
# -include $(ASSEM_SRC:.S=.d)
# endif