doc/generate-api/*
3rdparty/
+# Sample binary
+src/libedge-orchestration/lib/*
+src/libedge-orchestration/sample/orchestration_sample
+
# Test binary, build with `go test -c`
*.test
OBJECT_FILE_C := liborchestration.a
CMAIN_BIN_FILE := $(PKG_NAME)
CMAIN_DIR := $(BASE_DIR)/src/CMain
-CMAIN_INC_DIR := $(CMAIN_DIR)/inc
-CMAIN_BIN_DIR := $(CMAIN_DIR)/bin
-CMAIN_LIB_DIR := $(CMAIN_DIR)/lib
+ifeq ($(ARCH), arm)
+ CMAIN_INC_DIR := $(CMAIN_DIR)/inc/linux_arm
+ CMAIN_BIN_DIR := $(CMAIN_DIR)/bin/linux_arm
+ CMAIN_LIB_DIR := $(CMAIN_DIR)/lib/linux_arm
+else
+ CMAIN_INC_DIR := $(CMAIN_DIR)/inc
+ CMAIN_BIN_DIR := $(CMAIN_DIR)/bin
+ CMAIN_LIB_DIR := $(CMAIN_DIR)/lib
+endif
CMAIN_TEST_DIR := $(CMAIN_DIR)/unittest
# Library package
DBUS_CONF_DIR="/etc/dbus-1/system.d"
DBUS_SERVICE_DIR="/usr/share/dbus-1/system-services"
-BUILD_ALL=false
-BUILD_ARM=false
-BUILD_PKG=false
-
-case "$1" in
- "ubuntu")
- echo "*****************************"
- echo " Target Binary arch is amd64 "
- echo "*****************************"
- export GOARCH=amd64
- export CC="gcc"
- ;;
- "tizen")
- echo "*****************************"
- echo " Target Binary arch is armv7 "
- echo "*****************************"
- export GOARCH=arm GOARM=7
- export CC="arm-linux-gnueabi-gcc"
- ;;
- *)
- echo "build script"
- echo "Usage:"
- echo "---------------------------------------------------------"
- echo " $0 : build Go executable binary for amd64 "
- echo " $0 all : build C executable binary for amd64 "
- echo " $0 arm : build Go object for arm"
- echo " $0 tizen : build arm packages for Tizen"
- echo "---------------------------------------------------------"
- exit 0
- ;;
-esac
export GOPATH=$GOPATH:$BASE_DIR:$BASE_DIR/vendor
sudo systemctl status $SERVICE_FILE
}
-if [ "$1" == "ubuntu" ]; then
- if [ "$2" == "all" ]
- then
- build_clean
- install_prerequisite
- build_test
- build_object
- build_dbus
- build_binary
- lint_src_code
- register_service
- elif [ "$2" == "test" ]
- then
- build_test
- elif [ "$2" == "status" ]
- then
- sudo systemctl status ${SERVICE_FILE}
- elif [ "$2" == "start" ]
- then
- sudo systemctl daemon-reload
- sudo systemctl start ${SERVICE_FILE}
- sudo systemctl status ${SERVICE_FILE}
- elif [ "$2" == "stop" ]
- then
- sudo systemctl stop ${SERVICE_FILE}
- sudo systemctl status ${SERVICE_FILE}
- elif [ "$2" == "restart" ]
- then
- sudo systemctl daemon-reload
- sudo systemctl restart ${SERVICE_FILE}
- sudo systemctl status ${SERVICE_FILE}
- else
- build_clean
- build_binary
- fi
-elif [ "$1" == "tizen" ]; then
+function build_object_arm() {
+ echo ""
+ echo ""
+ echo "**********************************"
+ echo " Target Binary arch is armv7 "
+ echo "**********************************"
+ export GOARCH=arm GOARM=7
+ export CC="arm-linux-gnueabi-gcc"
+ export ARCH=arm
+
build_clean
build_object
+}
+
+
+# Always executed for creating orchestration library
+build_object_arm
+
+if [ "$1" == "tizen" ]; then
build_package
+else
+ echo ""
+ echo ""
+ echo "**********************************"
+ echo " Target Binary arch is amd64 "
+ echo "**********************************"
+ export GOARCH=amd64
+ export CC="gcc"
+ export ARCH=x86_64
+
+ case "$1" in
+ "all")
+ build_clean
+ install_prerequisite
+ build_test
+ build_object
+ build_dbus
+ build_binary
+ lint_src_code
+ register_service
+ ;;
+ "test")
+ build_test
+ ;;
+ "status")
+ sudo systemctl status ${SERVICE_FILE}
+ ;;
+ "start")
+ sudo systemctl daemon-reload
+ sudo systemctl start ${SERVICE_FILE}
+ sudo systemctl status ${SERVICE_FILE}
+ ;;
+ "stop")
+ sudo systemctl stop ${SERVICE_FILE}
+ sudo systemctl status ${SERVICE_FILE}
+ ;;
+ "restart")
+ sudo systemctl daemon-reload
+ sudo systemctl restart ${SERVICE_FILE}
+ sudo systemctl status ${SERVICE_FILE}
+ ;;
+ "")
+ build_clean
+ build_object
+ build_dbus
+ register_service
+ ;;
+ *)
+ echo "build script"
+ echo "Usage:"
+ echo "--------------------------------------------------------------"
+ echo " $0 : build Go executable binary for amd64 "
+ echo " $0 all : build C executable binary for amd64 "
+ echo " $0 tizen : build arm packages for Tizen"
+ echo "--------------------------------------------------------------"
+ exit 0
+ ;;
+ esac
fi
-
%build
export BASE_DIR=.
+export ARCH=arm
%if "%{go_build}" == "ON"
ORG_VENDOR_DIR='vendor'
%install
export BASE_DIR=.
+export ARCH=arm
%make_install
%post
#
# Target parameters
-BIN_DIR := bin
-LIB_DIR := lib
-INC_DIR := inc
+ifeq ($(ARCH), arm)
+ BIN_DIR := bin/linux_arm
+ LIB_DIR := lib/linux_arm
+ INC_DIR := inc/linux_arm
+else
+ BIN_DIR := bin
+ LIB_DIR := lib
+ INC_DIR := inc
+endif
SRC_DIR := src
LIBRARY_FILE := orchestration
BINARY_FILE := edge-orchestration
--- /dev/null
+../gdbus_interface.h
\ No newline at end of file
--- /dev/null
+/* Code generated by cmd/cgo; DO NOT EDIT. */
+
+/* package interface */
+
+
+#line 1 "cgo-builtin-prolog"
+
+#include <stddef.h> /* for ptrdiff_t below */
+
+#ifndef GO_CGO_EXPORT_PROLOGUE_H
+#define GO_CGO_EXPORT_PROLOGUE_H
+
+typedef struct { const char *p; ptrdiff_t n; } _GoString_;
+
+#endif
+
+/* Start of preamble from import "C" comments. */
+
+
+#line 29 "main.go"
+/*******************************************************************************
+ * Copyright 2019 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ *******************************************************************************/
+
+#line 1 "cgo-generated-wrapper"
+
+
+/* End of preamble from import "C" comments. */
+
+
+/* Start of boilerplate cgo prologue. */
+#line 1 "cgo-gcc-export-header-prolog"
+
+#ifndef GO_CGO_PROLOGUE_H
+#define GO_CGO_PROLOGUE_H
+
+typedef signed char GoInt8;
+typedef unsigned char GoUint8;
+typedef short GoInt16;
+typedef unsigned short GoUint16;
+typedef int GoInt32;
+typedef unsigned int GoUint32;
+typedef long long GoInt64;
+typedef unsigned long long GoUint64;
+typedef GoInt32 GoInt;
+typedef GoUint32 GoUint;
+typedef __SIZE_TYPE__ GoUintptr;
+typedef float GoFloat32;
+typedef double GoFloat64;
+typedef float _Complex GoComplex64;
+typedef double _Complex GoComplex128;
+
+/*
+ static assertion to make sure the file is being used on architecture
+ at least with matching size of GoInt.
+*/
+typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
+
+typedef _GoString_ GoString;
+typedef void *GoMap;
+typedef void *GoChan;
+typedef struct { void *t; void *v; } GoInterface;
+typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
+
+#endif
+
+/* End of boilerplate cgo prologue. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern int OrchestrationInit();
+
+extern int OrchestrationRequestService(char* p0, char* p1);
+
+extern int PrintLog(char* p0);
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null
+../orchestration_server.h
\ No newline at end of file
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
-typedef GoInt32 GoInt;
-typedef GoUint32 GoUint;
+typedef GoInt64 GoInt;
+typedef GoUint64 GoUint;
typedef __SIZE_TYPE__ GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
static assertion to make sure the file is being used on architecture
at least with matching size of GoInt.
*/
-typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
+typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
typedef _GoString_ GoString;
typedef void *GoMap;
LIBS := -lgtest -lgtest_main -lpthread -fprofile-arcs -ftest-coverage
# BUILDFLAGS := -lgtest -lgtest_main -lpthread -fprofile-arcs -ftest-coverage
-all: clean build execute lcov
+all: build execute lcov clean
build:
$(CC) $(TEST_FILE) -o $(EXEC_FILE) $(CFLAGS) $(LIBS) -I $(INC_DIR) -I $(SRC_DIR) `pkg-config --libs --cflags gio-2.0 gio-unix-2.0 glib-2.0`