From 6e00fd349c13effbb5bfda045ac6ca1c2e5d0393 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Tue, 7 Nov 2017 14:01:27 +0000 Subject: [PATCH] seperate libbase to the libapp --- Makefile.am | 3 +- configure.ac | 1 + lib/base/Makefile.am | 19 +++++----- src/Makefile.am | 63 +++++++++++++-------------------- src/{ => app}/app.h | 0 {lib/base => src/app}/context.c | 0 {lib/base => src/app}/context.h | 0 src/{ => app}/init.c | 0 src/hss/Makefile.am | 18 +++++++--- src/mme/Makefile.am | 18 +++++++--- src/pcrf/Makefile.am | 15 +++++--- src/pgw/Makefile.am | 18 +++++++--- src/sgw/Makefile.am | 15 +++++--- test/Makefile.am | 16 +++++---- 14 files changed, 109 insertions(+), 77 deletions(-) rename src/{ => app}/app.h (100%) rename {lib/base => src/app}/context.c (100%) rename {lib/base => src/app}/context.h (100%) rename src/{ => app}/init.c (100%) diff --git a/Makefile.am b/Makefile.am index 373137f9b..f7d59396f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,8 @@ nextepc_epcd_LDADD = $(top_srcdir)/src/libepc.la AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ - -I$(top_srcdir)/src + -I$(top_srcdir)/src/app \ + $(NULL) install-data-hook: $(MKDIR_P) $(DESTDIR)/$(localstatedir)/log/nextepc diff --git a/configure.ac b/configure.ac index a0c41cc4c..23390f661 100644 --- a/configure.ac +++ b/configure.ac @@ -423,6 +423,7 @@ AC_CONFIG_FILES([lib/fd/Makefile]) AC_CONFIG_FILES([lib/gtp/Makefile]) AC_CONFIG_FILES([lib/ipfw/Makefile]) AC_CONFIG_FILES([lib/Makefile]) +AC_CONFIG_FILES([src/app/Makefile]) AC_CONFIG_FILES([src/mme/Makefile]) AC_CONFIG_FILES([src/hss/Makefile]) AC_CONFIG_FILES([src/sgw/Makefile]) diff --git a/lib/base/Makefile.am b/lib/base/Makefile.am index 4f4ae97da..8c2897be3 100644 --- a/lib/base/Makefile.am +++ b/lib/base/Makefile.am @@ -3,27 +3,28 @@ pkglib_LTLIBRARIES = libbase.la libbase_la_SOURCES = \ - types.h context.h \ - types.c context.c + types.h types.c \ + $(NULL) libbase_la_DEPENDENCIES = \ - $(top_srcdir)/lib/core/src/libcore.la + $(top_srcdir)/lib/core/src/libcore.la \ + $(NULL) libbase_la_LIBADD = \ $(top_srcdir)/lib/core/src/libcore.la \ - @MONGOC_LIBS@ + $(NULL) AM_LDFLAGS = \ - -version-info @LIBVERSION@ + -version-info @LIBVERSION@ \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ - @MONGOC_CFLAGS@ + $(NULL) AM_CFLAGS = \ - -Wall -Werror - -DEFS = @DEFS@ -DSYSCONF_DIR=\"$(sysconfdir)/\" + -Wall -Werror \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = *.stackdump diff --git a/src/Makefile.am b/src/Makefile.am index 3902bdafe..d5299f0f8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,66 +1,53 @@ ## Process this file with automake to produce Makefile.in. -SUBDIRS = mme hss sgw pgw pcrf +SUBDIRS = app mme hss sgw pgw pcrf noinst_LTLIBRARIES = libmme.la libhss.la libsgw.la libpgw.la libpcrf.la libepc.la -COMMON_SOURCES = init.c -COMMON_INCLUDES = app.h +libmme_la_SOURCES = mme.c +libmme_la_DEPENDENCIES = $(top_srcdir)/src/mme/libmme.la +libmme_la_LIBADD = $(top_srcdir)/src/mme/libmme.la -libmme_la_SOURCES = $(COMMON_INCLUDES) mme.c $(COMMON_SOURCES) -libmme_la_DEPENDENCIES = \ - $(top_srcdir)/src/mme/libmme.la -libmme_la_LIBADD = \ - $(top_srcdir)/src/mme/libmme.la +libhss_la_SOURCES = hss.c +libhss_la_DEPENDENCIES = $(top_srcdir)/src/hss/libhss.la +libhss_la_LIBADD = $(top_srcdir)/src/hss/libhss.la -libhss_la_SOURCES = $(COMMON_INCLUDES) hss.c $(COMMON_SOURCES) -libhss_la_DEPENDENCIES = \ - $(top_srcdir)/src/hss/libhss.la -libhss_la_LIBADD = \ - $(top_srcdir)/src/hss/libhss.la +libsgw_la_SOURCES = sgw.c +libsgw_la_DEPENDENCIES = $(top_srcdir)/src/sgw/libsgw.la +libsgw_la_LIBADD = $(top_srcdir)/src/sgw/libsgw.la -libsgw_la_SOURCES = $(COMMON_INCLUDES) sgw.c $(COMMON_SOURCES) -libsgw_la_DEPENDENCIES = \ - $(top_srcdir)/src/sgw/libsgw.la -libsgw_la_LIBADD = \ - $(top_srcdir)/src/sgw/libsgw.la +libpgw_la_SOURCES = pgw.c +libpgw_la_DEPENDENCIES = $(top_srcdir)/src/pgw/libpgw.la +libpgw_la_LIBADD = $(top_srcdir)/src/pgw/libpgw.la -libpgw_la_SOURCES = $(COMMON_INCLUDES) pgw.c $(COMMON_SOURCES) -libpgw_la_DEPENDENCIES = \ - $(top_srcdir)/src/pgw/libpgw.la -libpgw_la_LIBADD = \ - $(top_srcdir)/src/pgw/libpgw.la +libpcrf_la_SOURCES = pcrf.c +libpcrf_la_DEPENDENCIES = $(top_srcdir)/src/pcrf/libpcrf.la +libpcrf_la_LIBADD = $(top_srcdir)/src/pcrf/libpcrf.la -libpcrf_la_SOURCES = $(COMMON_INCLUDES) pcrf.c $(COMMON_SOURCES) -libpcrf_la_DEPENDENCIES = \ - $(top_srcdir)/src/pcrf/libpcrf.la -libpcrf_la_LIBADD = \ - $(top_srcdir)/src/pcrf/libpcrf.la - -libepc_la_SOURCES = $(COMMON_INCLUDES) epc.c $(COMMON_SOURCES) +libepc_la_SOURCES = epc.c libepc_la_DEPENDENCIES = \ $(top_srcdir)/src/mme/libmme.la \ $(top_srcdir)/src/hss/libhss.la \ $(top_srcdir)/src/sgw/libsgw.la \ $(top_srcdir)/src/pgw/libpgw.la \ - $(top_srcdir)/src/pcrf/libpcrf.la + $(top_srcdir)/src/pcrf/libpcrf.la \ + $(NULL) libepc_la_LIBADD = \ $(top_srcdir)/src/mme/libmme.la \ $(top_srcdir)/src/hss/libhss.la \ $(top_srcdir)/src/sgw/libsgw.la \ $(top_srcdir)/src/pgw/libpgw.la \ - $(top_srcdir)/src/pcrf/libpcrf.la + $(top_srcdir)/src/pcrf/libpcrf.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ - -I$(top_srcdir)/lib/base + -I$(top_srcdir)/src/app \ + $(NULL) AM_CFLAGS = \ - -Wall -Werror - -DEFS = @DEFS@ \ - -DSYSCONF_DIR=\"$(sysconfdir)/\" \ - -DLOCALSTATE_DIR=\"$(localstatedir)/\" + -Wall -Werror \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = core *.stackdump diff --git a/src/app.h b/src/app/app.h similarity index 100% rename from src/app.h rename to src/app/app.h diff --git a/lib/base/context.c b/src/app/context.c similarity index 100% rename from lib/base/context.c rename to src/app/context.c diff --git a/lib/base/context.h b/src/app/context.h similarity index 100% rename from lib/base/context.h rename to src/app/context.h diff --git a/src/init.c b/src/app/init.c similarity index 100% rename from src/init.c rename to src/app/init.c diff --git a/src/hss/Makefile.am b/src/hss/Makefile.am index 1dc77881c..55a3508a9 100644 --- a/src/hss/Makefile.am +++ b/src/hss/Makefile.am @@ -4,13 +4,18 @@ noinst_LTLIBRARIES = libhss.la libhss_la_SOURCES = \ milenage.h hss_kdf.h hss_context.h hss_fd_path.h \ - milenage.c hss_kdf.c hss_init.c hss_context.c hss_fd_path.c + milenage.c hss_kdf.c hss_init.c hss_context.c hss_fd_path.c \ + $(NULL) libhss_la_DEPENDENCIES = \ - $(top_srcdir)/lib/fd/libfd.la + $(top_srcdir)/lib/fd/libfd.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) libhss_la_LIBADD = \ - $(top_srcdir)/lib/fd/libfd.la + $(top_srcdir)/lib/fd/libfd.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ @@ -18,10 +23,13 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/fd/s6a \ -I$(top_srcdir)/lib/fd \ -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ - @MONGOC_CFLAGS@ + -I$(top_srcdir)/src/app \ + @MONGOC_CFLAGS@ \ + $(NULL) AM_CFLAGS = \ - -Wall -Werror + -Wall -Werror \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = core *.stackdump diff --git a/src/mme/Makefile.am b/src/mme/Makefile.am index 2392730eb..c300c2e3a 100644 --- a/src/mme/Makefile.am +++ b/src/mme/Makefile.am @@ -20,7 +20,8 @@ libmme_la_SOURCES = \ emm_sm.c emm_handler.c emm_build.c \ esm_sm.c esm_handler.c esm_build.c \ mme_gtp_path.c mme_s11_build.c mme_s11_handler.c \ - mme_sm.c + mme_sm.c \ + $(NULL) if USRSCTP libmme_la_SOURCES += s1ap_usrsctp.c @@ -32,13 +33,17 @@ libmme_la_DEPENDENCIES = \ $(top_srcdir)/lib/s1ap/libs1ap.la \ $(top_srcdir)/lib/nas/libnas.la \ $(top_srcdir)/lib/fd/libfd.la \ - $(top_srcdir)/lib/gtp/libgtp.la + $(top_srcdir)/lib/gtp/libgtp.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) libmme_la_LIBADD = \ $(top_srcdir)/lib/s1ap/libs1ap.la \ $(top_srcdir)/lib/nas/libnas.la \ $(top_srcdir)/lib/fd/libfd.la \ - $(top_srcdir)/lib/gtp/libgtp.la + $(top_srcdir)/lib/gtp/libgtp.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ @@ -49,10 +54,13 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/fd/s6a \ -I$(top_srcdir)/lib/fd \ -I$(top_srcdir)/lib/gtp \ - -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include + -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ + -I$(top_srcdir)/src/app \ + $(NULL) AM_CFLAGS = \ - -Wall -Werror + -Wall -Werror \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = core *.stackdump diff --git a/src/pcrf/Makefile.am b/src/pcrf/Makefile.am index b37dbab5d..154c7abb0 100644 --- a/src/pcrf/Makefile.am +++ b/src/pcrf/Makefile.am @@ -4,13 +4,18 @@ noinst_LTLIBRARIES = libpcrf.la libpcrf_la_SOURCES = \ pcrf_context.h pcrf_fd_path.h \ - pcrf_init.c pcrf_context.c pcrf_fd_path.c + pcrf_init.c pcrf_context.c pcrf_fd_path.c \ + $(NULL) libpcrf_la_DEPENDENCIES = \ - $(top_srcdir)/lib/fd/libfd.la + $(top_srcdir)/lib/fd/libfd.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) libpcrf_la_LIBADD = \ - $(top_srcdir)/lib/fd/libfd.la + $(top_srcdir)/lib/fd/libfd.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ @@ -18,7 +23,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/fd/gx \ -I$(top_srcdir)/lib/fd \ -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ - @MONGOC_CFLAGS@ + -I$(top_srcdir)/src/app \ + @MONGOC_CFLAGS@ \ + $(NULL) AM_CFLAGS = \ -Wall -Werror diff --git a/src/pgw/Makefile.am b/src/pgw/Makefile.am index 0faefa1c6..f464b5fd6 100644 --- a/src/pgw/Makefile.am +++ b/src/pgw/Makefile.am @@ -10,17 +10,22 @@ libpgw_la_SOURCES = \ pgw_ipfw.c \ pgw_init.c pgw_event.c pgw_context.c pgw_sm.c \ pgw_gtp_path.c pgw_s5c_build.c pgw_s5c_handler.c \ - pgw_fd_path.c pgw_gx_handler.c + pgw_fd_path.c pgw_gx_handler.c \ + $(NULL) libpgw_la_DEPENDENCIES = \ $(top_srcdir)/lib/fd/libfd.la \ $(top_srcdir)/lib/gtp/libgtp.la \ - $(top_srcdir)/lib/ipfw/libipfw.la + $(top_srcdir)/lib/ipfw/libipfw.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) libpgw_la_LIBADD = \ $(top_srcdir)/lib/fd/libfd.la \ $(top_srcdir)/lib/gtp/libgtp.la \ - $(top_srcdir)/lib/ipfw/libipfw.la + $(top_srcdir)/lib/ipfw/libipfw.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ @@ -29,10 +34,13 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/fd \ -I$(top_srcdir)/lib/gtp \ -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ - -I$(top_srcdir)/lib/ipfw + -I$(top_srcdir)/lib/ipfw \ + -I$(top_srcdir)/src/app \ + $(NULL) AM_CFLAGS = \ - -Wall -Werror + -Wall -Werror \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = core *.stackdump diff --git a/src/sgw/Makefile.am b/src/sgw/Makefile.am index a216835df..2f2810d25 100644 --- a/src/sgw/Makefile.am +++ b/src/sgw/Makefile.am @@ -6,18 +6,25 @@ libsgw_la_SOURCES = \ sgw_event.h sgw_context.h \ sgw_gtp_path.h sgw_sm.h sgw_s11_handler.h sgw_s5c_handler.h \ sgw_init.c sgw_event.c sgw_context.c \ - sgw_gtp_path.c sgw_sm.c sgw_s11_handler.c sgw_s5c_handler.c + sgw_gtp_path.c sgw_sm.c sgw_s11_handler.c sgw_s5c_handler.c \ + $(NULL) libsgw_la_DEPENDENCIES = \ - $(top_srcdir)/lib/gtp/libgtp.la + $(top_srcdir)/lib/gtp/libgtp.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) libsgw_la_LIBADD = \ - $(top_srcdir)/lib/gtp/libgtp.la + $(top_srcdir)/lib/gtp/libgtp.la \ + $(top_srcdir)/src/app/libapp.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ -I$(top_srcdir)/lib/base \ - -I$(top_srcdir)/lib/gtp + -I$(top_srcdir)/lib/gtp \ + -I$(top_srcdir)/src/app \ + $(NULL) AM_CFLAGS = \ -Wall -Werror diff --git a/test/Makefile.am b/test/Makefile.am index 2d2b476c3..f18014a2d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -6,7 +6,8 @@ testepc_SOURCES = \ abts.h abts_tests.h testutil.h \ abts.c testutil.c testpacket.h testpacket.c \ base_test.c s1ap_message_test.c nas_message_test.c gtp_message_test.c \ - security_test.c s1setup_test.c attach_test.c volte_test.c handover_test.c + security_test.c s1setup_test.c attach_test.c volte_test.c handover_test.c \ + $(NULL) if USRSCTP testepc_SOURCES += testusrsctp.c @@ -15,7 +16,8 @@ testepc_SOURCES += testsctp.c endif testepc_LDADD = \ - $(top_srcdir)/src/libepc.la + $(top_srcdir)/src/libepc.la \ + $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir)/lib/core/include \ @@ -23,19 +25,21 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/s1ap/asn1c \ -I$(top_srcdir)/lib/s1ap \ -I$(top_srcdir)/lib/nas \ + -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ -I$(top_srcdir)/lib/fd/s6a \ -I$(top_srcdir)/lib/fd \ -I$(top_srcdir)/lib/gtp \ -I$(top_srcdir)/src/mme \ -I$(top_srcdir)/src/hss \ -I$(top_srcdir)/src/sgw \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/lib/@FREEDIAMETER_DIR@/include \ - @MONGOC_CFLAGS@ + -I$(top_srcdir)/src/app \ + @MONGOC_CFLAGS@ \ + $(NULL) AM_CFLAGS = \ -Wall -Werror \ - -Wno-unused-function -Wno-unused-variable + -Wno-unused-function -Wno-unused-variable \ + $(NULL) MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = core *.stackdump