File size: 831 Bytes
0ba037b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Host program for the LitePCIe build. LITEPCIE points at the driver directory
# that pcie/litex/bitacc_litefury.py --driver generates (<build>/driver).
LITEPCIE ?= ../../build/litefury/driver
CC       ?= cc
CFLAGS   ?= -O2 -Wall -Wextra
LIB      := $(LITEPCIE)/user/liblitepcie
INC      := -I$(LIB) -I$(LITEPCIE)/kernel

# Our code builds with -Werror; the generated library is compiled as shipped.
bitacc_pcie: bitacc_pcie.o litepcie_dma.o litepcie_helpers.o
	$(CC) -o $@ $^ -lm

bitacc_pcie.o: bitacc_pcie.c
	$(CC) $(CFLAGS) -Werror $(INC) -c -o $@ $<

litepcie_%.o: $(LIB)/litepcie_%.c
	$(CC) $(CFLAGS) $(INC) -c -o $@ $<

# CPU baseline for the range operations (no driver needed).
cpu_bench: cpu_bench.c
	$(CC) -O3 -march=native -Wall -Wextra -Werror -o $@ $< -lpthread

clean:
	rm -f bitacc_pcie cpu_bench *.o
.PHONY: clean