Committing in PDCP code
[o-du/l2.git] / build / common / du_app.mak
1 ################################################################################
2 #   Copyright (c) [2017-2019] [Radisys]                                        #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16
17 # This is makefile for DU APP
18
19 include ../common/rsys_fancy.mak
20 include ../common/env.mak
21 COLOR=$(COLOR_RED)
22
23 SRC_DIR=$(ROOT_DIR)/src/du_app/
24 C_SRCS=$(wildcard $(SRC_DIR)/*.c)
25 C_OBJS=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(C_SRCS))
26 LOG_FILES=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.i,$(C_SRCS))
27 BAK_FILES=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.i.bak,$(C_SRCS))
28 DB_FILES =$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.i.db,$(C_SRCS))
29
30 # prepare the list of common header files
31 HDR_FILES+=$(wildcard $(CM_DIR)/env*.[hx])
32 HDR_FILES+=$(wildcard $(CM_DIR)/gen*.[hx])
33 HDR_FILES+=$(wildcard $(CM_DIR)/ssi*.[hx])
34 HDR_FILES+=$(wildcard $(CM_DIR)/cm*.[hx])
35 HDR_FILES+=$(wildcard $(CM_DIR)/lkw*.[hx])
36 HDR_FILES+=$(wildcard $(CM_DIR)/lrg*.[hx])
37
38
39 lib: $(LIB_DIR)/libduapp.a
40 include $(COM_BUILD_DIR)/compile.mak
41
42 I_OPTS+=-I$(ROOT_DIR)/src/mt
43 I_OPTS+=-I$(SRC_DIR)/F1AP
44
45
46 #-------------------------------------------------------------#
47 #Linker macros
48 #-------------------------------------------------------------#
49 ifeq ($(BIN_LOG),YES)
50 $(LIB_DIR)/libduapp.a:$(C_OBJS) $(C_WO_PED_OBJS)
51         @echo -e "Creating log DB $(COLOR)$(LOG_DIR)/duLog.db $(REVERT_COLOR)"
52                   $(Q)cat $(DB_FILES) > $(LOG_DIR)/duLog.db
53                   @echo -e "Creating Archive $(COLOR) $@ $(REVERT_COLOR)"
54                   $(Q)ar -cr $(LIB_DIR)/libduapp.a $(C_OBJS) $(C_WO_PED_OBJS)
55 else
56 $(LIB_DIR)/libduapp.a:$(C_OBJS) $(C_WO_PED_OBJS)
57                   @echo -e "Creating Archive $(COLOR) $@ $(REVERT_COLOR)"
58                   $(Q)ar -cr $(LIB_DIR)/libduapp.a $(C_OBJS) $(C_WO_PED_OBJS)
59 endif
60
61 #-------------------------------------------------------------#
62 #Clean macros
63 #-------------------------------------------------------------#
64 clean:
65                   @echo -e "$(COLOR_RED)Cleaning DU APP$(REVERT_COLOR)"
66                   @echo $(SRC_DIR) $(CM_DIR)
67                   $(Q)\rm -f $(LIB_DIR)/libduapp.a $(C_OBJS) $(C_WO_PED_OBJS) $(LOG_FILES) $(BAK_FILES)
68