-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
55 lines (43 loc) · 1.38 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
# Created by the Intel FPGA Monitor Program
# DO NOT MODIFY
############################################
# Global Defines
DEFINE_COMMA := ,
############################################
# Compilation Targets
# Programs
AS := arm-altera-eabi-as
CC := arm-altera-eabi-gcc
LD := arm-altera-eabi-ld
OC := arm-altera-eabi-objcopy
RM := rm -f
# Flags
USERCCFLAGS := -g -O1 -std=gnu99
ARCHASFLAGS := -mfloat-abi=soft -march=armv7-a -mcpu=cortex-a9 --gstabs -I "$$GNU_ARM_TOOL_ROOTDIR/arm-altera-eabi/include/"
ARCHCCFLAGS := -mfloat-abi=soft -march=armv7-a -mtune=cortex-a9 -mcpu=cortex-a9
ARCHLDFLAGS := --defsym arm_program_mem=0x40 --defsym arm_available_mem_size=0x3fffffb8 --defsym __cs3_stack=0x3ffffff8 --section-start .vectors=0x0
ARCHLDSCRIPT := -T"C:/intelFPGA_lite/18.0/University_Program/Monitor_Program/build/altera-socfpga-hosted-with-vectors.ld"
ASFLAGS := $(ARCHASFLAGS)
CCFLAGS := -Wall -c $(USERCCFLAGS) $(ARCHCCFLAGS)
LDFLAGS := $(patsubst %, -Wl$(DEFINE_COMMA)%, $(ARCHLDFLAGS)) $(ARCHLDSCRIPT)
OCFLAGS := -O srec
# Files
HDRS :=
SRCS := main.c
OBJS := $(patsubst %, %.o, $(SRCS))
# Targets
compile: main.srec
main.srec: main.axf
$(RM) $@
$(OC) $(OCFLAGS) $< $@
main.axf: $(OBJS)
$(RM) $@
$(CC) $(LDFLAGS) $(OBJS) -o $@
%.c.o: %.c $(HDRS)
$(RM) $@
$(CC) $(CCFLAGS) $< -o $@
%.s.o: %.s $(HDRS)
$(RM) $@
$(AS) $(ASFLAGS) $< -o $@
clean:
$(RM) main.srec main.axf $(OBJS)