-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (57 loc) · 1.86 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
VERBOSE=1
ifeq ($(VERBOSE),1)
ECHO :=
else
ECHO := @
endif
# Where is the Altera SDK for OpenCL software?
ifeq ($(wildcard $(ALTERAOCLSDKROOT)),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation)
endif
ifeq ($(wildcard $(ALTERAOCLSDKROOT)/host/include/CL/opencl.h),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation.)
endif
# OpenCL compile and link flags.
AOCL_COMPILE_CONFIG := $(shell aocl compile-config )
# AOCL_LINK_CONFIG := $(shell aocl link-config )
# ignore -L/opt/altera_pro/16.0/hld/host/arm32/lib
# delete -lalterammdpcie since there is only 32bit version of libalterammdpcie.so
AOCL_LINK_CONFIG := -L/opt/altera_pro/16.0/hld/board/altera_a10socdk/arm32/lib -L/opt/altera_pro/16.0/hld/host/linux64/lib -Wl,--no-as-needed -lalteracl -lalterahalmmd -lelf #-lalterammdpcie
#AOCL_COMPILE_CONFIG := $(shell aocl compile-config --arm)
#AOCL_LINK_CONFIG := $(shell aocl link-config --arm)
# Compilation flags
ifeq ($(DEBUG),1)
CXXFLAGS += -g
else
CXXFLAGS += -O0
endif
# Compiler
CXX := g++ -m64 # -m32
#CXX := arm-linux-gnueabihf-g++
# Target
TARGET := host
TARGET_DIR := bin
# Directories
INC_DIRS := ./aocl/common/inc
LIB_DIRS :=
# Files
INCS := $(wildcard )
SRCS := $(wildcard host/src/*.cpp ./aocl/common/src/AOCLUtils/*.cpp)
LIBS := rt
# Make it all!
all : $(TARGET_DIR)/$(TARGET)
# Host executable target.
$(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INCS) $(TARGET_DIR)
$(ECHO) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
$(AOCL_COMPILE_CONFIG) $(SRCS) $(AOCL_LINK_CONFIG) \
$(foreach D,$(LIB_DIRS),-L$D) \
$(foreach L,$(LIBS),-l$L) \
-o $(TARGET_DIR)/$(TARGET)
$(TARGET_DIR) :
$(ECHO)mkdir $(TARGET_DIR)
# Standard make targets
clean :
$(ECHO)rm -f $(TARGET_DIR)/$(TARGET)
distclean :
$(ECHO)rm -rf $(TARGET_DIR)
.PHONY : all clean