-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
52 lines (37 loc) · 1.06 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
IDIR = include
CC = gcc
CFLAGS = --std=c99 -O3 -g -Wall -Wextra -I $(IDIR) -I ./PIM-common/common/include -I ./PIM-common/host/include
DPU_OPTS = `dpu-pkg-config --cflags --libs dpu`
# define DEBUG in the source if we are debugging
ifeq ($(DEBUG), 1)
DEBUG_CPU=1
DEBUG_DPU=1
endif
ifeq ($(DEBUG_CPU), 1)
CFLAGS+=-DDEBUG
endif
ifeq ($(DEBUG_DPU), 1)
CFLAGS+=-DDEBUG_DPU
endif
# Collect statistics about various operations
STATS ?= 0
# How many files can be assigned to a single DPU
MAX_FILES_PER_DPU ?= 1
# How many tasklets should each DPU use for decompression
NR_TASKLETS ?= 1
ifeq ($(STATS), 1)
CFLAGS+=-DSTATISTICS
endif
SOURCE = src/jpeg-host.c src/bmp.c src/jpeg-cpu.c
.PHONY: default all dpu host clean tags
default: all
all: dpu host
clean:
$(RM) host-*
$(MAKE) -C src/dpu clean
dpu:
$(MAKE) DEBUG=$(DEBUG_DPU) NR_TASKLETS=$(NR_TASKLETS) STATS=$(STATS) -C src/dpu
host: $(SOURCE)
$(CC) $(CFLAGS) -DNR_TASKLETS=$(NR_TASKLETS) -DMAX_FILES_PER_DPU=$(MAX_FILES_PER_DPU) $^ -o $@-$(NR_TASKLETS) $(DPU_OPTS)
tags:
ctags -R -f tags . ~/projects/upmem/upmem-sdk