-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
55 lines (43 loc) · 1.51 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 := nios2-elf-as
CC := nios2-elf-gcc
LD := nios2-elf-ld
OC := nios2-elf-objcopy
RM := rm -f
# Flags
USERCCFLAGS := -g -O1 -ffunction-sections -fverbose-asm -fno-inline -mno-cache-volatile
ARCHASFLAGS := --gstabs -I "C:/intelFPGA_lite/18.1/nios2eds/components/altera_nios2/sdk/inc/"
ARCHCCFLAGS := -mno-hw-mul -mno-hw-div -I "C:/intelFPGA_lite/18.1/nios2eds/components/altera_nios2/HAL/inc/" -DSYSTEM_BUS_WIDTH=32 -DALT_SINGLE_THREADED -D_JTAG_UART_BASE=8264u
ARCHLDFLAGS := --defsym nasys_stack_top=0x1000 --defsym nasys_program_mem=0x0 --defsym nasys_data_mem=0x0
ARCHLDSCRIPT := --script="C:/intelFPGA_lite/18.1/University_Program/Monitor_Program/build/nios_as_build.ld"
ASFLAGS := $(ARCHASFLAGS)
CCFLAGS := -Wall -c $(USERCCFLAGS) $(ARCHCCFLAGS)
LDFLAGS := $(ARCHLDFLAGS) $(ARCHLDSCRIPT) -e _start -u _start
OCFLAGS := -O srec
# Files
HDRS :=
SRCS := AssemblyCode/new_assembly_pong.s
OBJS := $(patsubst %, %.o, $(SRCS))
# Targets
COMPILE: new_assembly_pong.srec
new_assembly_pong.srec: new_assembly_pong.elf
$(RM) $@
$(OC) $(OCFLAGS) $< $@
new_assembly_pong.elf: $(OBJS)
$(RM) $@
$(LD) $(LDFLAGS) $(OBJS) -o $@
%.c.o: %.c $(HDRS)
$(RM) $@
$(CC) $(CCFLAGS) $< -o $@
%.s.o: %.s $(HDRS)
$(RM) $@
$(AS) $(ASFLAGS) $< -o $@
CLEAN:
$(RM) new_assembly_pong.srec new_assembly_pong.elf $(OBJS)