-
Notifications
You must be signed in to change notification settings - Fork 251
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (123 loc) · 5.67 KB
/
Makefile
File metadata and controls
147 lines (123 loc) · 5.67 KB
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
141
142
143
144
145
146
147
#-------------------------------------------------------------------------------
# Copyright (C) 2016 Freescale Semiconductor, Inc.
# Copyright 2016-2020 NXP
# All rights reserved.
#
# THIS SOFTWARE IS PROVIDED BY FREESCALE "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 FREESCALE 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.
#-------------------------------------------------------------------------------
.NOTPARALLEL:
this_makefile := $(firstword $(MAKEFILE_LIST))
ERPC_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../)
include $(ERPC_ROOT)/mk/erpc_common.mk
ERPC_C_ROOT = $(ERPC_ROOT)/erpc_c
# TARGET_OUTPUT_ROOT = $(OUTPUT_ROOT)/$(DEBUG_OR_RELEASE)/$(os_name)/$(APP_NAME)
#-----------------------------------------------
# setup variables
# ----------------------------------------------
LIB_NAME = erpc
TARGET_OUTPUT_ROOT = $(OUTPUT_ROOT)/$(DEBUG_OR_RELEASE)/$(os_name)/$(LIB_NAME)
TARGET_LIB = $(LIBS_ROOT)/lib$(LIB_NAME).a
OBJS_ROOT = $(TARGET_OUTPUT_ROOT)/obj
LIBS_ROOT = $(TARGET_OUTPUT_ROOT)/lib
#-----------------------------------------------
# Include path. Add the include paths like this:
# INCLUDES += ./include/
#-----------------------------------------------
INCLUDES += $(ERPC_C_ROOT)/config \
$(ERPC_C_ROOT)/infra \
$(ERPC_C_ROOT)/port \
$(ERPC_C_ROOT)/setup \
$(ERPC_C_ROOT)/transports
SOURCES += $(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.cpp \
$(ERPC_C_ROOT)/infra/erpc_basic_codec.cpp \
$(ERPC_C_ROOT)/infra/erpc_client_manager.cpp \
$(ERPC_C_ROOT)/infra/erpc_crc16.cpp \
$(ERPC_C_ROOT)/infra/erpc_framed_transport.cpp \
$(ERPC_C_ROOT)/infra/erpc_message_buffer.cpp \
$(ERPC_C_ROOT)/infra/erpc_message_loggers.cpp \
$(ERPC_C_ROOT)/infra/erpc_server.cpp \
$(ERPC_C_ROOT)/infra/erpc_simple_server.cpp \
$(ERPC_C_ROOT)/infra/erpc_transport_arbitrator.cpp \
$(ERPC_C_ROOT)/infra/erpc_pre_post_action.cpp \
$(ERPC_C_ROOT)/port/erpc_port_stdlib.cpp \
$(ERPC_C_ROOT)/port/erpc_threading_pthreads.cpp \
$(ERPC_C_ROOT)/port/erpc_serial.cpp \
$(ERPC_C_ROOT)/setup/erpc_arbitrated_client_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_client_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_mbf_dynamic.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_mbf_static.cpp \
$(ERPC_C_ROOT)/setup/erpc_server_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_serial.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_tcp.cpp \
$(ERPC_C_ROOT)/transports/erpc_inter_thread_buffer_transport.cpp \
$(ERPC_C_ROOT)/transports/erpc_serial_transport.cpp \
$(ERPC_C_ROOT)/transports/erpc_tcp_transport.cpp
HEADERS += $(ERPC_C_ROOT)/config/erpc_config.h \
$(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.h \
$(ERPC_C_ROOT)/infra/erpc_basic_codec.h \
$(ERPC_C_ROOT)/infra/erpc_client_manager.h \
$(ERPC_C_ROOT)/infra/erpc_codec.h \
$(ERPC_C_ROOT)/infra/erpc_crc16.h \
$(ERPC_C_ROOT)/infra/erpc_common.h \
$(ERPC_C_ROOT)/infra/erpc_version.h \
$(ERPC_C_ROOT)/infra/erpc_framed_transport.h \
$(ERPC_C_ROOT)/infra/erpc_manually_constructed.h \
$(ERPC_C_ROOT)/infra/erpc_message_buffer.h \
$(ERPC_C_ROOT)/infra/erpc_message_loggers.h \
$(ERPC_C_ROOT)/infra/erpc_server.h \
$(ERPC_C_ROOT)/infra/erpc_static_queue.h \
$(ERPC_C_ROOT)/infra/erpc_transport_arbitrator.h \
$(ERPC_C_ROOT)/infra/erpc_transport.h \
$(ERPC_C_ROOT)/infra/erpc_client_server_common.h \
$(ERPC_C_ROOT)/infra/erpc_pre_post_action.h \
$(ERPC_C_ROOT)/port/erpc_setup_extensions.h \
$(ERPC_C_ROOT)/port/erpc_config_internal.h \
$(ERPC_C_ROOT)/port/erpc_port.h \
$(ERPC_C_ROOT)/port/erpc_threading.h \
$(ERPC_C_ROOT)/port/erpc_serial.h \
$(ERPC_C_ROOT)/setup/erpc_arbitrated_client_setup.h \
$(ERPC_C_ROOT)/setup/erpc_client_setup.h \
$(ERPC_C_ROOT)/setup/erpc_mbf_setup.h \
$(ERPC_C_ROOT)/setup/erpc_server_setup.h \
$(ERPC_C_ROOT)/setup/erpc_transport_setup.h \
$(ERPC_C_ROOT)/transports/erpc_inter_thread_buffer_transport.h \
$(ERPC_C_ROOT)/transports/erpc_serial_transport.h \
$(ERPC_C_ROOT)/transports/erpc_tcp_transport.h
MAKE_TARGET = $(TARGET_LIB)($(OBJECTS_ALL))
include $(ERPC_ROOT)/mk/targets.mk
include $(ERPC_ROOT)/mk/pkgconfig.mk
$(TARGET_LIB)(%): %
@$(call printmessage,ar,Archiving, $(?F) in $(@F))
$(at)mkdir -p $(dir $(@))
$(AR) $(ARFLAGS) $@ $?
.PHONY: install
install: install_headers install_lib
.PHONY: install_headers
install_headers: $(HEADERS) | $(INC_INSTALL_DIR)
@$(call printmessage,c,Installing, headers in $(INC_INSTALL_DIR))
$(at)mkdir -p $(INC_INSTALL_DIR)
$(at)install $(?) $(INC_INSTALL_DIR)
$(INC_INSTALL_DIR):
$(at)mkdir -p $(INC_INSTALL_DIR)
.PHONY: install_lib
install_lib: $(TARGET_LIB)
@$(call printmessage,c,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(LIB_INSTALL_DIR)/$(arch_libdir))
$(at)mkdir -p $(LIB_INSTALL_DIR)/$(arch_libdir)
$(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR)/$(arch_libdir)
.PHONY: install_pc
install_pc: $(LIB_NAME).pc
@$(call printmessage,ar,pkg-config version, $(ERPC_VERSION))
@$(call printmessage,ar,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(CFG_INSTALL_DIR))
$(at)mkdir -p $(CFG_INSTALL_DIR)
$(at)install $(LIB_NAME).pc $(CFG_INSTALL_DIR)
clean::
$(at)rm -rf $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c