Common ONLP shared library and static binary build makefiles.

This commit is contained in:
Jeffrey Townsend
2019-07-08 21:52:56 +00:00
parent 09d70858d5
commit f44525c29f
4 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIRECTORIES := lib onlps
include $(ONL)/make/subdirs.mk

View File

@@ -0,0 +1,32 @@
ifndef PLATFORM
$(error $$PLATFORM not set)
endif
ifndef ARCH
# Determine ARCH from platform name
ifeq ($(findstring x86-64-,$(PLATFORM)),x86-64-)
ARCH := amd64
endif
ifeq ($(findstring powerpc-,$(PLATFORM)),powerpc-)
ARCH := powerpc
endif
ifeq ($(findstring arm-,$(PLATFORM)),arm-)
ARCH := armel
endif
ifeq ($(findstring arm64-,$(PLATFORM)),arm64-)
ARCH := arm64
endif
endif
ifndef ARCH
$(error $$ARCH not set and the architecture cannot be determined from the given platform name ($(PLATFORM)))
endif
ifndef PLATFORM_MODULE
PLATFORM_MODULE := $(subst -,_,$(PLATFORM))
endif
include $(ONL)/make/config.$(ARCH).mk

View File

@@ -0,0 +1,41 @@
############################################################
# <bsn.cl fy=2014 v=onl>
#
# Copyright 2014-2018 BigSwitch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the
# License.
#
# </bsn.cl>
############################################################
include $(ONL)/packages/base/any/onlp/builds/platform/common.mk
MODULE := libonlp-$(PLATFORM)
include $(BUILDER)/standardinit.mk
DEPENDMODULES := AIM IOF onlplib $(DEPENDMODULES) $(PLATFORM_MODULE) $(EXTRA_MODULES)
DEPENDMODULE_HEADERS := $(DEPENDMODULE_HEADERS) sff
include $(BUILDER)/dependmodules.mk
SHAREDLIB := libonlp-$(PLATFORM).so
$(SHAREDLIB)_TARGETS := $(ALL_TARGETS)
include $(BUILDER)/so.mk
.DEFAULT_GOAL := $(SHAREDLIB)
GLOBAL_CFLAGS += -I$(onlp_BASEDIR)/module/inc
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1
GLOBAL_CFLAGS += -fPIC
GLOBAL_LINK_LIBS += -lpthread
include $(BUILDER)/targets.mk

View File

@@ -0,0 +1,43 @@
############################################################
# <bsn.cl fy=2014 v=onl>
#
# Copyright 2014-2018 BigSwitch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the
# License.
#
# </bsn.cl>
############################################################
include $(ONL)/packages/base/any/onlp/builds/platform/common.mk
.DEFAULT_GOAL := onlps
MODULE := onlps
include $(BUILDER)/standardinit.mk
DEPENDMODULES := $(DEPENDMODULES) AIM IOF onlp onlplib $(PLATFORM_MODULE) onlp_platform_defaults sff cjson cjson_util timer_wheel OS uCli ELS $(EXTRA_MODULES)
include $(BUILDER)/dependmodules.mk
BINARY := onlps
$(BINARY)_LIBRARIES := $(LIBRARY_TARGETS)
include $(BUILDER)/bin.mk
GLOBAL_CFLAGS += -DAIM_CONFIG_AIM_MAIN_FUNCTION=onlpdump_main
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MAIN=1
GLOBAL_CFLAGS += -DUCLI_CONFIG_INCLUDE_ELS_LOOP=1
GLOBAL_CFLAGS += -DONLP_CONFIG_INCLUDE_UCLI=1
GLOBAL_LINK_LIBS += -lpthread -lm -ledit
include $(BUILDER)/targets.mk