-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.27 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
# Quelldatei
SRCDIR = src
BUILD = build
# Objektdatei
OBJDIR = obj
CFILES := $(foreach dir, $(SRCDIR)/, $(notdir $(wildcard $(SRCDIR)/*.c)))
ASMFILES := $(foreach dir, $(SRCDIR)/, $(notdir $(wildcard $(SRCDIR)/*.S)))
OBJS := $(addprefix $(OBJDIR)/, $(CFILES:.c=.o) $(ASMFILES:.S=.o))
# Includedatei
INCLUDE = -I ../h -I include
# Toolchain
TOOLCHAIN = arm-eb63-elf-
# Compiler
COMPILER = gcc
# Linker/Binder
LINKER = ld
# Debugger
DEBUGGER = insight
# Optimierungsstufe
OPTI = 0
OUTPUT = ausschank
# Bauen
all: $(OBJS)
# Erzeugen der benoetitgen Objektdateien
# $(TOOLCHAIN)$(COMPILER) -c -g -O$(OPTI) ../boot/swi.S -o $(OBJDIR)/swi.o $(INCLUDE)
$(TOOLCHAIN)$(COMPILER) -c -g -O$(OPTI) ../boot/boot_ice.S -o $(OBJDIR)/boot_ice.o $(INCLUDE)
# Binden fuer die RAM-Version
$(TOOLCHAIN)$(LINKER) -Ttext 0x02000000 -O$(OPTI) $(OBJDIR)/boot_ice.o $(OBJS) -o $(OUTPUT).elf /opt/arm-eb63-elf/lib/gcc/arm-eb63-elf/4.4.6/libgcc.a
$(OBJDIR)/%.o: $(SRCDIR)/%.S
@mkdir -p $(OBJDIR)
$(TOOLCHAIN)$(COMPILER) -c -g -O$(OPTI) $< $(INCLUDE) -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@mkdir -p $(OBJDIR)
$(TOOLCHAIN)$(COMPILER) -c -g -O$(OPTI) $< $(INCLUDE) -o $@
# Debugger starten
debug:
$(TOOLCHAIN)$(DEBUGGER) $(OUTPUT).elf
doc:
doxygen doxygen.conf
# Aufraeumen
clean:
rm -r $(OBJDIR)
rm *.elf