summaryrefslogtreecommitdiffstats
blob: 16e9434c529b04e5d8ebc0fee13b6fad8efc998c (plain) (blame)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Copyright (C) 2013-2015 Texas Instruments Incorporated - http://www.ti.com/
#
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#
#    Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#    Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
#
#    Neither the name of Texas Instruments Incorporated nor the names of
#    its contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cJSON_DIR = $(MPM_UTILS)/cJSON
cJSON_OBJ = $(cJSON_DIR)/cJSON.o

SERDES_DIR = ti/csl/src/ip/serdes_sb/V0
SERDES_OBJ = \
	csl_wiz8_sb_refclk156p25MHz_20bit_6p25Gbps.o \
	csl_wiz8_sb_refclk156p25MHz_20bit_5Gbps_sr1.o \
	csl_wiz8_sb_refclk156p25MHz_20bit_10Gbps_sr1.o \
	csl_wiz8_sb_refclk156p25MHz_20bit_12p5Gbps_sr1.o \
	csl_wiz8_sb_refclk312p5MHz_20bit_6p25Gbps.o \
	csl_wiz8_sb_refclk312p5MHz_20bit_5Gbps_sr1.o \
	csl_wiz8_sb_refclk312p5MHz_20bit_10Gbps_sr1.o \
	csl_wiz8_sb_refclk312p5MHz_20bit_12p5Gbps_sr1.o \
	csl_wiz8_sb_refclk125MHz_20bit_5Gbps.o \
	csl_wiz8_sb_refclk125MHz_20bit_6p25Gbps.o \
	csl_wiz8_sb_refclk156p25MHz_20bit_5Gbps.o

EDMA3_DIR = $(MPM_UTILS)/edma3
EDMA3_OBJ = $(EDMA3_DIR)/mpm_transport_edma3.o $(EDMA3_DIR)/mpm_transport_edma3_osal.o evmTCI6636K2HSample.o

KEYSTONE_MMAP_DIR = $(MPM_UTILS)/keystone_mmap
KEYSTONE_MMAP_OBJ = $(KEYSTONE_MMAP_DIR)/mpm_transport_keystone_mmap.o $(KEYSTONE_MMAP_DIR)/mpm_transport_keystone_mmap_osal.o

UIO_DIR = $(MPM_UTILS)/uio
UIO_OBJ = $(UIO_DIR)/uioutils.o

RM_DIR = $(MPM_UTILS)/rm
RM_OBJ = $(RM_DIR)/mpm_transport_rm_osal.o $(RM_DIR)/mpm_transport_rm.o

FW_DIR = $(MPM_UTILS)/fw_mem
FW_OBJ = $(FW_DIR)/fw_mem_allocator.o $(FW_DIR)/fw_mem_allocator_osal.o

MPMTRANSPORT_OBJS = mpm_transport.o $(MPMTRANSPORT_SHAREDMEM_OBJS) $(cJSON_OBJ) $(SERDES_OBJ) $(EDMA3_OBJ) $(KEYSTONE_MMAP_OBJ) $(UIO_OBJ) $(RM_OBJ) $(FW_OBJ)  $(MPMTRANSPORT_QMSS_OBJS)

ifeq ($(HYPLNK_TRANSPORT),true)
MPMTRANSPORT_OBJS +=  $(MPMTRANSPORT_HYPLNK_OBJS)
endif

ifeq ($(SRIO_TRANSPORT),true)
MPMTRANSPORT_OBJS +=  $(MPMTRANSPORT_SRIO_OBJS)
endif

MPMTRANSPORT_SHAREDMEM_OBJS = sharedmem/mpm_transport_sharedmem.o

ifeq ($(HYPLNK_TRANSPORT),true)
MPMTRANSPORT_HYPLNK_OBJS = hyplnk/mpm_transport_hyplnk.o hyplnk/mpm_transport_hyplnk_interface.o
endif
MPMTRANSPORT_QMSS_OBJS = qmss/mpm_transport_qmss_interface.o qmss/mpm_transport_qmss.o qmss/mpm_transport_qmss_osal.o
ifeq ($(SRIO_TRANSPORT),true)
MPMTRANSPORT_SRIO_OBJS = srio/mpm_transport_srio.o srio/mpm_transport_srio_osal.o
endif
MPMTRANSPORT_OBJS_SO = $(patsubst %.o, %.so, $(MPMTRANSPORT_OBJS))

MPMTRANSPORT_TEST_DIR = test

TIME_PROFILE_DIR = $(MPM_UTILS)/time_profile

MPMTRANSPORT_INC = -I. -I$(MPM_INC) -I$(MPM_UTILS) -I./sharedmem -I./qmss
ifeq ($(SRIO_TRANSPORT),true)
MPMTRANSPORT_INC += -I./srio
endif
ifeq ($(HYPLNK_TRANSPORT),true)
MPMTRANSPORT_INC += -I./hyplnk
endif

EDMA3_INC = -I$(EDMA3_DIR)
KEYSTONE_MMAP_INC = -I$(KEYSTONE_MMAP_DIR)
UIO_INC = -I$(UIO_DIR)
RM_INC = -I$(RM_DIR)
FW_INC = -I$(FW_DIR)
TIME_PROFILE_INC = -I$(TIME_PROFILE_DIR)
PERIPHERAL_LIBS = -ledma3 -ledma3rm -lkeystonemmap -lrm -lqmss_device -lcppi_device  -lticmem
ifeq ($(HYPLNK_TRANSPORT),true)
PERIPHERAL_LIBS += -lhyplnk_device
endif
ifeq ($(SRIO_TRANSPORT),true)
PERIPHERAL_LIBS += -lsrio
endif

VPATH += $(DEVKIT_INC)/$(SERDES_DIR) $(DEVKIT_INC)/ti/sdo/edma3/drv/sample/src/platforms/

.PHONY: all clean distclean mpm_transport_test

all: $(MPM_LIB)/$(MPMTRANSPORT_LIB) $(MPM_LIB)/$(MPMTRANSPORT_LIB_SO) mpm_transport_test

$(MPM_LIB)/$(MPMTRANSPORT_LIB): $(MPMTRANSPORT_OBJS)
	@echo ***Archiving $@
	$(AR) ${ARFLAGS} $@ $^

$(MPM_LIB)/$(MPMTRANSPORT_LIB_SO): $(MPMTRANSPORT_OBJS_SO)
	@echo ***Archiving $@
	$(CC) $^ -Wl,-soname=$(MPMTRANSPORT_LIB_SO).1 $(PERIPHERAL_LIBS) -shared -fPIC -o $(MPMTRANSPORT_LIB_SO).1.0.0
	@ln -s $(MPMTRANSPORT_LIB_SO).1.0.0 $(MPMTRANSPORT_LIB_SO).1
	@ln -s $(MPMTRANSPORT_LIB_SO).1     $(MPMTRANSPORT_LIB_SO)
	@mv -f $(MPMTRANSPORT_LIB_SO)* $(MPM_LIB)

%.o: %.c
	$(CC) $(MPMTRANSPORT_INC) -I$(DEVKIT_INC) $(EDMA3_INC) $(KEYSTONE_MMAP_INC) $(UIO_INC) $(RM_INC) $(FW_INC) $(TIME_PROFILE_INC) $(INTERNALDEFS) -DSTATIC_BUILD -c -o $@ $<

%.so: %.c
	$(CC) $(MPMTRANSPORT_INC) -I$(DEVKIT_INC) $(EDMA3_INC) $(KEYSTONE_MMAP_INC) $(UIO_INC) $(RM_INC) $(FW_INC) $(TIME_PROFILE_INC) $(INTERNALDEFS) -fPIC -c -o $@ $<

mpm_transport_test:
	make -C $(MPMTRANSPORT_TEST_DIR)

clean: 
	make -C $(MPMTRANSPORT_TEST_DIR) clean
	rm -rf $(MPMTRANSPORT_LIB) $(MPMTRANSPORT_OBJS) $(MPMTRANSPORT_OBJS_SO)