-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (40 loc) · 1.17 KB
/
Makefile
File metadata and controls
50 lines (40 loc) · 1.17 KB
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
# LAB04 Example Makefile
#
# This makefile is intended for use with GNU make
# This example is intended to be built with Linaro bare-metal GCC
TARGET=Lab04.axf
CC=aarch64-elf-gcc
LD=aarch64-elf-gcc
# Select build rules based on Windows or Unix
ifdef WINDIR
DONE=@if exist $(1) echo Build completed.
RM=if exist $(1) del /q $(1)
SHELL=$(WINDIR)\system32\cmd.exe
else
ifdef windir
DONE=@if exist $(1) echo Build completed.
RM=if exist $(1) del /q $(1)
SHELL=$(windir)\system32\cmd.exe
else
DONE=@if [ -f $(1) ]; then echo Build completed.; fi
RM=rm -f $(1)
endif
endif
all: $(TARGET)
$(call DONE,$(TARGET))
rebuild: clean all
clean:
$(call RM,*.o)
$(call RM,$(TARGET))
main.o: main.c
# Compile for best debug view (lowest optimization)
$(CC) -c -march=armv8-a -g -O0 $^ -o $@
my_mul.o: my_mul.S
# Compile for best debug view (lowest optimization)
# $(CC) -c -march=armv8-a -g -O0 $^ -o $@
lab04b.o: lab04b.S my_mul.o
# Compile for best debug view (lowest optimization)
$(CC) -c -march=armv8-a -g -O0 $^ -o $@
$(TARGET): main.o lab04b.o
# Link with specific base address to suit VE model memory layout
$(LD) --specs=aem-ve.specs -Wl,--build-id=none main.o lab04b.o my_mul.o -o $@