# macro for output file name and makefile name
#
-prepare_dirs:
- $(Q)echo -e "Preparing directories for build..."
- $(Q)mkdir -p $(BUILD_DIR)/obj/odu
- $(Q)mkdir -p $(LOG_ROOT)/odu
- $(Q)mkdir -p $(LIB_ROOT)/odu
- $(Q)echo -e "Directories are successfully prepared"
-
-PLTFRM_FLAGS= -UMSPD -DODU
+PLTFRM_FLAGS= -UMSPD -DODU #-DEGTP_TEST
ifeq ($(MODE),TDD)
PLTFRM_FLAGS += -DMODE=TDD
PLTFRM_FLAGS += -DCA_ENABLE=YES
endif
+ifeq ($(NODE),CU_STUB)
+ PLTFRM_FLAGS+=-DODU_TEST_STUB
+endif
+
# The include options get merged with the options needed by
# # the called makefiles and hence we export these to make them
# # available to them.
export I_OPTS
# Add to the linker options the platform specific components
+#L_OPTS+=-lnsl -lrt -lm -lpthread -lsctp
L_OPTS+=-lnsl -lrt -lm -lpthread -lsctp
# Export some of the flags expected from the command line.
@echo -e "******************************************************************"
@echo -e "BUILD COMMAND DESCRIPTION "
@echo -e "------------------------------------------------------------------"
- @echo -e "$(RULE)odu - Builds all components of ODU$(NORM)"
+ @echo -e "$(RULE)odu - Builds all components of ODU$(NORM)"
+ @echo -e "$(RULE)cu_stub - Builds all CU Stub$(NORM)"
+ @echo -e "$(RULE)clean_odu - clean up ODU$(NORM)"
+ @echo -e "$(RULE)clean_cu - clean up CU Stub$(NORM)"
+ @echo -e "$(RULE)clean_all - cleanup everything$(NORM)"
@echo -e "$(OPTS) options: $(NORM)"
@echo -e "$(OPTS) MACHINE=BIT64/BIT32 - Default is BIT32$(NORM)"
- @echo -e "$(OPTS) TEXT_LOG=YES - With text logging instead of binary$(NORM)"
- @echo -e "$(OPTS) MODE=TDD - If not specified, MODE=FDD$(NORM)"
- @echo -e "$(RULE)clean_all tdd cleanup everything$(NORM)"
+ @echo -e "$(OPTS) MODE=TDD - If not specified, MODE=FDD$(NORM)"
@echo -e "******************************************************************"
+prepare_dirs:
+ $(Q)echo -e "Preparing directories for build..."
+ $(Q)mkdir -p $(BUILD_DIR)/obj/odu
+ $(Q)mkdir -p $(LIB_ROOT)/odu
+ $(Q)mkdir -p $(ROOT_DIR)/libs/
+ $(Q)mkdir -p $(BIN_DIR)/odu
+ $(Q)mkdir -p $(BIN_DIR)/config
+ $(Q)mkdir -p $(ROOT_DIR)/bin
+ $(Q)echo -e "Directories are successfully prepared"
+
+prepare_cu_dirs:
+ $(Q)echo -e "Preparing directories for build..."
+ $(Q)mkdir -p $(BUILD_DIR)/obj/cu_stub
+ $(Q)mkdir -p $(LIB_ROOT)/cu_stub
+ $(Q)mkdir -p $(BIN_DIR)/cu_stub
+ $(Q)echo -e "Directories are successfully prepared"
+
du:
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_common.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_f1ap.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_sysinfo.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/du_app.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
- $(Q)$(MAKE) -f $(COM_BUILD_DIR)/f1ap.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
- $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn.mak OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/od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ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
-clean:
+link_du: du
+ $(Q)$(CC1) -g -o $(OBJ_ROOT)/odu/odu -Wl,-R../lib/:. $(OBJ_ROOT)/odu/*.o\
+ $(L_OPTS) -L$(LIB_ROOT)/odu -L$(ROOT_DIR)/libs/odu
+
+clean_odu:
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/du_app.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
- $(Q)$(MAKE) -f $(COM_BUILD_DIR)/f1ap.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
- $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_common.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_f1ap.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_sysinfo.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/kw.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/cm.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
- $(Q)$(MAKE) -f $(COM_BUILD_DIR)/rg.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mac.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/sch.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/mt.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/rl.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
$(Q)$(MAKE) -f $(COM_BUILD_DIR)/phy_stub.mak clean OBJ_DIR=$(OBJ_ROOT)/odu LIB_DIR=$(LIB_ROOT)/odu LOG_DIR=$(LOG_ROOT)/odu CC='$(CC1)'
+ $(Q)rm -rf $(OBJ_ROOT)/odu/*
+ $(Q)rm -rf $(LIB_ROOT)/odu/*
+ $(Q)rm -rf $(BIN_DIR)/odu/*
+ $(Q)rm -rf $(ROOT_DIR)/bin/odu
+ $(Q)echo -e "***** ODU CLEAN COMPLETE *****"
-clean_all: clean
+clean_all: clean_odu clean_cu
$(Q)rm -rf $(OBJ_ROOT)
$(Q)rm -rf $(LIB_ROOT)
$(Q)rm -rf $(LOG_ROOT)
- $(Q)rm -rf bin
-link_all: du
- $(Q)$(CC1) -g -o $(OBJ_ROOT)/odu/odu -Wl,-R../lib/:. $(OBJ_ROOT)/odu/*.o\
- $(L_OPTS) -L$(LIB_ROOT)/odu -L$(ROOT_DIR)/libs/odu
-
-odu: prepare_dirs copy_build
-
-copy_build: link_all
- $(Q)mkdir -p bin bin/config bin/odu bin/scripts
-ifneq ($(TEXT_LOG), YES)
- $(Q)cp -f ./obj/odu/rlogapp bin/odu
- $(Q)cat $(LOG_ROOT)/odu/*.db > $(LOG_ROOT)/odu/rlog.logdb
- $(Q)cp -f $(LOG_ROOT)/odu/rlog.logdb odu/bin/
- $(Q)echo -e "Completed generation of log database"
-endif
+ $(Q)rm -rf $(BIN_DIR)
+ $(Q)rm -rf $(ROOT_DIR)/bin
+ $(Q)rm -rf $(ROOT_DIR)/libs
+
+cu:
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/cu_stub.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_common.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_f1ap.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_sysinfo.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/cm.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mt.mak OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+
+clean_cu:
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/cu_stub.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_common.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_f1ap.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/asn_sysinfo.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/cm.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)$(MAKE) -f $(COM_BUILD_DIR)/mt.mak clean OBJ_DIR=$(OBJ_ROOT)/cu_stub LIB_DIR=$(LIB_ROOT)/cu_stub LOG_DIR=$(LOG_ROOT)/cu_stub CC='$(CC1)'
+ $(Q)rm -rf $(OBJ_ROOT)/cu_stub/*
+ $(Q)rm -rf $(LIB_ROOT)/cu_stub/*
+ $(Q)rm -rf $(BIN_DIR)/cu_stub/*
+ $(Q)rm -rf $(ROOT_DIR)/bin/cu_stub
+ $(Q)echo -e "***** CU STUB CLEAN COMPLETE *****"
+
+link_cu:
+ $(Q)$(CC1) -g -o $(OBJ_ROOT)/cu_stub/cu_stub -Wl,-R../lib/:. $(OBJ_ROOT)/cu_stub/*.o\
+ $(L_OPTS) -L$(LIB_ROOT)/cu_stub -L$(ROOT_DIR)/libs/cu_stub
+ $(Q)cp -f ./obj/cu_stub/cu_stub ./bin/cu_stub
+ $(Q)cp -rf ./bin/cu_stub $(ROOT_DIR)/bin/
+ $(Q)cp -f ../scripts/cu_script.sh $(ROOT_DIR)/bin/cu_stub
+ $(Q)echo -e "***** CU STUB BUILD COMPLETE *****"
+
+copy_build: link_du
$(Q)cp -f ./obj/odu/odu ./bin/odu
-# $(Q)cp -f ../config/wr_cfg_fdd.txt ./odu/bin/wr_cfg.txt
-# $(Q)cp -f ../config/ys_cfg.txt ./odu/bin/ys_cfg.txt
$(Q)cp -f ../config/ssi_mem ./bin/config
- $(Q)cp -rf ./bin $(ROOT_DIR)/bin/
- $(Q)mkdir -p $(ROOT_DIR)/libs/
+ $(Q)cp -rf ./bin/odu $(ROOT_DIR)/bin/
+ $(Q)cp -rf ./bin/config $(ROOT_DIR)/bin/
+ $(Q)cp -f ../scripts/odu_script.sh $(ROOT_DIR)/bin/odu
$(Q)cp -f ./lib/odu/*.a $(ROOT_DIR)/libs/
$(Q)echo -e "***** BUILD COMPLETE *****"
+
+odu: prepare_dirs copy_build
+
+cu_stub: prepare_cu_dirs cu link_cu
+