forked from riverdi/riverdi-eve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.linux
82 lines (62 loc) · 1.48 KB
/
Makefile.linux
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
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Copyright (c) Riverdi Sp. z o.o. sp. k. <riverdi@riverdi.com>
# Copyright (c) Skalski Embedded Technologies <contact@lukasz-skalski.com>
#
# Project name
PROJECT = riverdi-demo
# List all C defines here
DEFS = -DLINUX_PLATFORM
DEFS += -DBUFFER_OPTIMIZATION
DEFS += -DEVE_2
DEFS += -DCTP_50
# Define optimisation level here
OPT =
# Tools
PREFIX =
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
GDB = $(PREFIX)gdb
CP = $(PREFIX)objcopy
AS = $(PREFIX)gcc -x assembler-with-cpp
# List of source files
SRC = ./$(PROJECT).c
SRC += ./host_layer/linux/platform.c
SRC += ./eve_layer/Gpu_Hal.c
SRC += ./eve_layer/CoPro_Cmds.c
SRC += ./eve_layer/Hal_Utils.c
SRC += ./app_layer/App_Common.c
# List all include directories here
INCDIRS = ./
INCDIRS += ./host_layer/linux
INCDIRS += ./eve_layer
INCDIRS += ./app_layer
INCDIRS += ./riverdi_modules
# List the user directory to look for the libraries here
LIBDIRS +=
# List all user libraries here
LIBS =
# Dirs
OBJS = $(SRC:.c=.o)
INCDIR = $(patsubst %,-I%, $(INCDIRS))
LIBDIR = $(patsubst %,-L%, $(LIBDIRS))
LIB = $(patsubst %,-l%, $(LIBS))
# Flags
COMMONFLAGS =
ASFLAGS = $(COMMONFLAGS)
CPFLAGS = $(COMMONFLAGS) $(DEFS)
LDFLAGS = $(COMMONFLAGS) $(LIBDIR) $(LIB)
#
# Makefile Rules
#
all: $(PROJECT)
$(PROJECT): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
%.o: %.c
$(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
%.o: %.s
$(AS) -c $(ASFLAGS) $< -o $@
clean:
-rm -rf $(PROJECT)
-rm -rf $(OBJS)
-rm -rf $(SRC:.c=.lst)
-rm -rf $(ASRC:.s=.lst)