Skip to content

Commit

Permalink
Release 1.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
damjan-we committed Sep 18, 2018
1 parent f8b95f3 commit e368be0
Show file tree
Hide file tree
Showing 239 changed files with 33,196 additions and 2,978 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -13,4 +13,5 @@ files.idx
.project
.cproject
.vscode
.buildnum
.buildnum
/doc
2 changes: 1 addition & 1 deletion .version
@@ -1 +1 @@
1.0.0.0
1.2.0.0
1 change: 1 addition & 0 deletions 3rdparty
143 changes: 25 additions & 118 deletions Makefile
@@ -1,7 +1,10 @@
default: all

include build/color.mk

# Default configuration
include build/default.mk
include build/flags.mk

# Modify default configuration for external vendors
include build/vendor.mk
Expand All @@ -12,103 +15,48 @@ include build/target-arch.mk
# Include vendor-specific configuration
include build/vendor-arch.mk

# KConfig configuration
include build/kconfig.mk

# Create CFG_DEFINES based on configuration options
include build/cfg-defines.mk

# Vendor defines
include build/vendor-defines.mk

ifneq ($(_OVERRIDE_MAIN_MAKEFILE),1)

.PHONY: all build_all clean distclean FORCE

all: build_all

world: build_all
$(MAKE) openwrt_all

MAKEFLAGS := --no-print-directory

CP = cp
MKDIR = mkdir -p
DIRNAME = dirname
CAT = cat
SED = sed
MV = mv -f
RM = rm -f
CHMOD = chmod
INSTALL = install -D
TAR = tar
GREP = grep

SRCEXT = cpp
SRCEXT.c = c
DEPEXT = d
OBJEXT = o

SRCDIR = src
WORKDIR = work/$(TARGET)
OBJDIR = $(WORKDIR)/obj
BINDIR = $(WORKDIR)/bin
LIBDIR = $(WORKDIR)/lib
BUILD_ROOTFS_DIR = $(WORKDIR)/rootfs
APP_ROOTFS ?= $(BUILD_ROOTFS_DIR)
IMAGEDIR = images
WORKDIRS = $(WORKDIR) $(OBJDIR) $(LIBDIR) $(BINDIR) $(BUILD_ROOTFS_DIR) $(IMAGEDIR)

CFLAGS := -Wall -Wextra -Wno-unused-parameter -Wno-unused-label -Werror
CFLAGS += $(CFG_DEFINES)
CFLAGS += -fasynchronous-unwind-tables -rdynamic

# Below are global settings that need to be used
DEBUG := -g
OPTIMIZE :=

LDFLAGS := -rdynamic

# Include architecture specific makefile
include $(ARCH_MK)

# Controls whether complete compilation lines are printed or not
ifeq ($(V),1)
Q=
NQ=@echo
Q_NULL=
else
Q=@
NQ=@echo
Q_STDOUT = >/dev/null
Q_STDERR = 2>/dev/null
endif

CFLAGS := $(CFLAGS) $(OPTIMIZE) $(DEBUG) $(DEFINES) $(INCLUDES)
LIBS := $(LIBS) -lpthread

TARGET_DEF := TARGET_$(shell echo -n "$(TARGET)" | tr -sc '[A-Za-z0-9]' _ | tr '[a-z]' '[A-Z]')
CFLAGS += -D$(TARGET_DEF) -DTARGET_NAME="\"$(TARGET)\""

.PHONY: build_all workdirs clean distclean FORCE

include build/flags2.mk
include build/dirs.mk
include build/verbose.mk
include build/version.mk
include build/git.mk
include build/unit-build.mk
include build/tags.mk
include build/app_install.mk
include build/ovsdb.mk
include build/rootfs.mk
include build/schema.mk
include build/devshell.mk
include build/help.mk
include build/doc.mk

$(WORKDIRS):
$(Q)mkdir -p $@

workdirs: $(WORKDIRS)

build_all: workdirs schema-check unit-install # rootfs
build_all: workdirs schema-check unit-install

clean: unit-clean
$(NQ) " $(call color_clean,clean) [$(call COLOR_BOLD,workdir)] $(WORKDIR)"
$(Q)$(RM) -r $(WORKDIR)

.PHONY: schema-check
schema-check:
$(Q)build/schema.sh check || { echo "The OVS schema was changed but the version was not updated. Please run make schema-update"; exit 1; }

.PHONY: schema-update
schema-update:
@build/schema.sh update

DISTCLEAN_TARGETS := clean

distclean: $(DISTCLEAN_TARGETS)
Expand All @@ -120,8 +68,9 @@ $(error Unsupported TARGET ($(TARGET)). Supported targets are: \
$(COL_CFG_GREEN)$(OS_TARGETS)$(COL_CFG_NONE))
endif

# Include makefile for vendor-specific rules, if it exists
-include $(VENDOR_DIR)/Makefile
# Include makefile for target-specific rules, if it exists
TARGET_MAKEFILE ?= $(VENDOR_DIR)/Makefile
-include $(TARGET_MAKEFILE)

# backward compatibility
SDK_DIR ?= $(OWRT_ROOT)
Expand All @@ -131,47 +80,5 @@ ifeq ($(INSTALL_ROOTFS_DIR),)
INSTALL_ROOTFS_DIR = $(WORKDIR)/rootfs-install
endif

DEVSHELL ?= $(SHELL)
devshell:
$(NQ) "make: running devshell TARGET=$(TARGET) DEVSHELL=$(DEVSHELL)"
@PS1='TARGET=$(TARGET) $$PWD $$ ' $(DEVSHELL)
$(NQ) "make: exit devshell TARGET=$(TARGET)"


help:
$(NQ) "Makefile help"
$(NQ) ""
$(NQ) "Makefile commands:"
$(NQ) " all builds all enabled units"
$(NQ) " os builds device image based on specified SDK"
$(NQ) " tags Creates CTAGS for src directories"
$(NQ) " cscope Creates CSCOPE for the same directories as ctags"
$(NQ) " clean Removes generated, compiled objects"
$(NQ) " distclean Invokes clean and also cleans the ctags and cscope files"
$(NQ) " devshell Run shell with all environment variables set for TARGET"
$(NQ) ""
$(NQ) "Build Unit commands:"
$(NQ) " unit-all Build ALL active units"
$(NQ) " unit-install Build and install ALL active units"
$(NQ) " unit-clean Clean ALL active units"
$(NQ) " unit-list List ALL active units"
$(NQ) ""
$(NQ) " UNIT_PATH/clean Clean a single UNIT"
$(NQ) " UNIT_PATH/rclean Clean a single UNIT and its dependencies"
$(NQ) " UNIT_PATH/compile Compile a single UNIT and its dependencies"
$(NQ) " UNIT_PATH/install Install UNIT products to target rootfs"
$(NQ) ""
$(NQ) "Control variables:"
$(NQ) " V make verbose level. (values: 0, 1)"
$(NQ) " default = 0"
$(NQ) " TARGET Target identifier. See Supported targets."
$(NQ) " default: $(DEFAULT_TARGET)"
$(NQ) " current: $(TARGET)"
$(NQ) " Supported targets:"
@for x in $(OS_TARGETS); do echo " "$$x; done
$(NQ) " IMAGE_TYPE squashfs (FLASH) or initramfs(BOOTP),"
$(NQ) " default: $(DEFAULT_IMAGE_TYPE)"
$(NQ) " IMAGE_DEPLOYMENT_PROFILE Supported deployment profiles:"
@for x in $(VALID_IMAGE_DEPLOYMENT_PROFILES); do echo " "$$x; done
$(NQ) ""
endif # _OVERRIDE_MAIN_MAKEFILE

5 changes: 5 additions & 0 deletions build/cfg-defines.mk
Expand Up @@ -53,3 +53,8 @@ endif # BUILD_CLIENT_NICKNAME
ifeq ($(BUILD_CLIENT_FREEZE),y)
CFG_DEFINES += -DUSE_CLIENT_FREEZE
endif # BUILD_CLIENT_FREEZE

ifeq ($(BUILD_REMOTE_LOG),y)
CFG_DEFINES += -DBUILD_REMOTE_LOG
endif

28 changes: 28 additions & 0 deletions build/default.mk
Expand Up @@ -27,6 +27,7 @@ TOP_SDK := ../sdk
DEFAULT_IMAGE_TYPE := squashfs
DEFAULT_TARGET := native
INSTALL_PREFIX ?= /usr/plume
ROOTFS_COMPONENTS ?= common target/$(TARGET) $(ROOTFS_PROFILE_COMPONENTS)

# Build features
CFG_DEFINES :=
Expand All @@ -51,3 +52,30 @@ BUILD_CAPACITY_QUEUE_STATS ?= n
BUILD_CLIENT_NICKNAME ?= n
# specifies whether client freeze support is built or not
BUILD_CLIENT_FREEZE ?= n
# remote mqtt logging
BUILD_REMOTE_LOG ?= y
# backtrace based on libgcc_s
BUILD_WITH_LIBGCC_BACKTRACE ?= y


# Default shell commands and flags

MAKEFLAGS := --no-print-directory

CP = cp
MKDIR = mkdir -p
DIRNAME = dirname
CAT = cat
SED = sed
MV = mv -f
RM = rm -f
CHMOD = chmod
INSTALL = install -D
TAR = tar
GREP = grep

SRCEXT = cpp
SRCEXT.c = c
DEPEXT = d
OBJEXT = o

30 changes: 30 additions & 0 deletions build/devshell.mk
@@ -0,0 +1,30 @@
# Copyright (c) 2015, Plume Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the Plume Design Inc. nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 Plume Design Inc. 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.

.PHONY: devshell
DEVSHELL ?= $(SHELL)
devshell:
$(NQ) "make: running devshell TARGET=$(TARGET) DEVSHELL=$(DEVSHELL)"
@PS1='TARGET=$(TARGET) $$PWD $$ ' $(DEVSHELL)
$(NQ) "make: exit devshell TARGET=$(TARGET)"
39 changes: 39 additions & 0 deletions build/dirs.mk
@@ -0,0 +1,39 @@
# Copyright (c) 2015, Plume Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the Plume Design Inc. nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 Plume Design Inc. 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.

SRCDIR = src
WORKDIR ?= work/$(TARGET)
OBJDIR = $(WORKDIR)/obj
BINDIR = $(WORKDIR)/bin
LIBDIR = $(WORKDIR)/lib
BUILD_ROOTFS_DIR ?= $(WORKDIR)/rootfs
APP_ROOTFS ?= $(BUILD_ROOTFS_DIR)
IMAGEDIR = images
WORKDIRS = $(WORKDIR) $(OBJDIR) $(LIBDIR) $(BINDIR) $(BUILD_ROOTFS_DIR) $(IMAGEDIR)

$(WORKDIRS):
$(Q)mkdir -p $@

.PHONY: workdirs
workdirs: $(WORKDIRS)
32 changes: 32 additions & 0 deletions build/doc.mk
@@ -0,0 +1,32 @@
# Copyright (c) 2015, Plume Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the Plume Design Inc. nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 Plume Design Inc. 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.

.PHONY: doc
doc:
$(NQ) " $(call color_generate,doc) $(call color_target,[HTML])"
$(Q)cd doc; doxygen doxygen.conf > doxygen.log 2>&1
$(Q)echo -n " "; ls -l doc/html/index.html
$(NQ) " $(call color_generate,doc) $(call color_target,[PDF])"
$(Q)-cd doc/latex; make > make.log 2>&1
$(Q)echo -n " "; ls -l doc/latex/*.pdf
38 changes: 38 additions & 0 deletions build/flags.mk
@@ -0,0 +1,38 @@
# Copyright (c) 2015, Plume Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the Plume Design Inc. nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 Plume Design Inc. 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.

# C FLAGS
CFLAGS := -Wall -Wextra -Werror
CFLAGS += -Wno-unused-parameter
CFLAGS += -Wno-unused-label
CFLAGS += -Wno-strict-aliasing
CFLAGS += -fasynchronous-unwind-tables -rdynamic

DEBUGFLAGS := -g
OPTIMIZE :=

# LD FLAGS
LDFLAGS := -rdynamic
LIBS += -lpthread

0 comments on commit e368be0

Please sign in to comment.