From ef7c97457011c980a7d5d171d227becc7958b9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Fri, 14 Jun 2019 09:21:39 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E5=A2=9E=E5=8A=A0=20trace=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20Makefile=20=E5=B7=A5=E7=A8=8B=E6=96=87?= =?UTF-8?q?=E4=BB=B6=202.=20=E6=9B=B4=E6=AD=A3=20git=20=E5=AF=B9=20build?= =?UTF-8?q?=20=E7=9B=AE=E5=BD=95=E4=B8=8B=E9=9D=A2=20Makefile=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +- Platform/build/module.netlink_api.Makefile | 49 ++++++++++++++ Platform/build/module.trace_relay.Makefile | 50 ++++++++++++++ Platform/build/user.trace.api.Makefile | 77 ++++++++++++++++++++++ Platform/build/user.trace.test.Makefile | 77 ++++++++++++++++++++++ 5 files changed, 257 insertions(+), 2 deletions(-) create mode 100755 Platform/build/module.netlink_api.Makefile create mode 100755 Platform/build/module.trace_relay.Makefile create mode 100755 Platform/build/user.trace.api.Makefile create mode 100755 Platform/build/user.trace.test.Makefile diff --git a/.gitignore b/.gitignore index 5139c8fb4..f37f838dc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,9 @@ GRTAGS GTAGS .tmp_versions/ -Platform/build/ -Product/build/ +Platform/build/.build/ +Product/build/.build/ +Platform/build/debug/ +Product/build/debug/ .vscode/ _install/ diff --git a/Platform/build/module.netlink_api.Makefile b/Platform/build/module.netlink_api.Makefile new file mode 100755 index 000000000..0a40ed018 --- /dev/null +++ b/Platform/build/module.netlink_api.Makefile @@ -0,0 +1,49 @@ +# target name, the target name must have the same name of c source file +TARGET_NAME=netlink + +# target +# for linux module driver: KO +# for application: EXE +# for dynamic library: DLL +TARGET_TYPE = KO + +# target object +# for application: APP +# for device driver: DRV +TARGET_OBJ = DRV + +# custom install dir +TARGET_BOX = + +#debug mode or release mode +DEBUG = TRUE + +PLAT_LINUX ?= TRUE +PLAT_ARM64 ?= TRUE + +VPATH = ../modules/netlink_api + +# source code + +# set the source file, don't used .o because of ... + +COMMON_SRCS = libnetlink_k.c netlink_mod.c + +# MRS Board Source Files +PLAT_LINUX_SRCS = $(COMMON_SRCS) +PLAT_ARM64_SRCS = $(COMMON_SRCS) + +# gcc CFLAGS + + +# this line must be at below of thus, because of... +include ../../Common/common.Makefile + +ifeq ($(MAKECMDGOALS), ) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +else +ifeq ($(MAKECMDGOALS), all) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +endif +endif + diff --git a/Platform/build/module.trace_relay.Makefile b/Platform/build/module.trace_relay.Makefile new file mode 100755 index 000000000..ac87e572f --- /dev/null +++ b/Platform/build/module.trace_relay.Makefile @@ -0,0 +1,50 @@ +# target name, the target name must have the same name of c source file +TARGET_NAME=trace_relay + +# target +# for linux module driver: KO +# for application: EXE +# for dynamic library: DLL +TARGET_TYPE = KO + +# target object +# for application: APP +# for device driver: DRV +TARGET_OBJ = DRV + +# custom install dir +TARGET_BOX = + +#debug mode or release mode +DEBUG = TRUE + +PLAT_LINUX ?= TRUE +PLAT_ARM64 ?= TRUE + +VPATH = ../modules/trace-relay + +# source code + +# set the source file, don't used .o because of ... + +COMMON_SRCS = trace_init.c \ + trace_init_mod.c + +# MRS Board Source Files +PLAT_LINUX_SRCS = $(COMMON_SRCS) +PLAT_ARM64_SRCS = $(COMMON_SRCS) + +# gcc CFLAGS +PLAT_ARM64_CFLAGS := -I../modules/netlink_api/ -I../../Common +PLAT_LINUX_CFLAGS := $(PLAT_ARM64_CFLAGS) + +# this line must be at below of thus, because of... +include ../../Common/common.Makefile + +ifeq ($(MAKECMDGOALS), ) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +else +ifeq ($(MAKECMDGOALS), all) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +endif +endif diff --git a/Platform/build/user.trace.api.Makefile b/Platform/build/user.trace.api.Makefile new file mode 100755 index 000000000..58a21fc21 --- /dev/null +++ b/Platform/build/user.trace.api.Makefile @@ -0,0 +1,77 @@ +# target name, the target name must have the same name of c source file +TARGET_NAME=libtraceapi + +# target +# for linux module driver: KO +# for application: EXE +# for dynamic library: DLL +TARGET_TYPE = DLL + +# target object +# for application: APP +# for device driver: DRV +TARGET_OBJ = APP + +# custom install dir +TARGET_BOX = + +#debug mode or release mode +DEBUG = TRUE + +PLAT_LINUX ?= TRUE +PLAT_ARM64 ?= TRUE + +VPATH = ../user/trace/trace-api + +# source code + +# set the source file, don't used .o because of ... + +COMMON_SRCS = trace_api.c + +# MRS Board Source Files +PLAT_LINUX_SRCS = $(COMMON_SRCS) +PLAT_ARM64_SRCS = $(COMMON_SRCS) + +# gcc CFLAGS +PLAT_ARM64_CFLAGS := -fPIC -I../../Common -I../user/netlink_uapi +PLAT_LINUX_CFLAGS := $(PLAT_ARM64_CFLAGS) + + +PLAT_ARM64_LDFLAGS := -fPIC -shared -lpthread +PLAT_LINUX_LDFLAGS := $(PLAT_ARM64_LDFLAGS) + + +#gcc libs +ARM64_LIBS := ./libnetlinku-arm64.so +LINUX_LIBS := ./libnetlinku-linux.so + +ifeq ($(PLAT_ARM64), TRUE) +DEPEND_LIB += ./debug/libnetlinku-arm64.so +USER_CLEAN_ITEMS += ./libnetlinku-arm64.so +endif + +ifeq ($(PLAT_LINUX), TRUE) +DEPEND_LIB += ./debug/libnetlinku-linux.so +USER_CLEAN_ITEMS += ./libnetlinku-linux.so +endif + +# this line must be at below of thus, because of... +include ../../Common/common.Makefile + +ifneq ($(MAKECMDGOALS), clean) +ifneq ($(MAKECMDGOALS), cleanall) +ifneq ($(notdir $(DEPEND_LIB)), $(wildcard $(DEPEND_LIB))) +$(shell $(CP) $(DEPEND_LIB) ./) +endif +endif +endif + +ifeq ($(MAKECMDGOALS), ) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +else +ifeq ($(MAKECMDGOALS), all) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +endif +endif + diff --git a/Platform/build/user.trace.test.Makefile b/Platform/build/user.trace.test.Makefile new file mode 100755 index 000000000..917beb760 --- /dev/null +++ b/Platform/build/user.trace.test.Makefile @@ -0,0 +1,77 @@ +# target name, the target name must have the same name of c source file +TARGET_NAME=test-trace + +# target +# for linux module driver: KO +# for application: EXE +# for dynamic library: DLL +TARGET_TYPE = EXE + +# target object +# for application: APP +# for device driver: DRV +TARGET_OBJ = APP + +# custom install dir +TARGET_BOX = + +#debug mode or release mode +DEBUG = TRUE + +PLAT_LINUX ?= TRUE +PLAT_ARM64 ?= TRUE + +VPATH = ../user/trace/test + +# source code + +# set the source file, don't used .o because of ... + +COMMON_SRCS = test_client_main.c + +# MRS Board Source Files +PLAT_LINUX_SRCS = $(COMMON_SRCS) +PLAT_ARM64_SRCS = $(COMMON_SRCS) + +# gcc CFLAGS +PLAT_ARM64_CFLAGS := -I../user/trace/trace-api -I../../Common -I../common +PLAT_LINUX_CFLAGS := $(PLAT_ARM64_CFLAGS) + + +PLAT_ARM64_LDFLAGS := -lpthread +PLAT_LINUX_LDFLAGS := + + +#gcc libs +ARM64_LIBS := ./libtraceapi-arm64.so ./libnetlinku-arm64.so +LINUX_LIBS := ./libtraceapi-linux.so ./libnetlinku-linux.so -lpthread + +ifeq ($(PLAT_ARM64), TRUE) +DEPEND_LIB += ./debug/libtraceapi-arm64.so ./debug/libnetlinku-arm64.so +USER_CLEAN_ITEMS += ./libtraceapi-arm64.so +endif + +ifeq ($(PLAT_LINUX), TRUE) +DEPEND_LIB += ./debug/libtraceapi-linux.so ./debug/libnetlinku-linux.so +USER_CLEAN_ITEMS += ./libtraceapi-linux.so +endif + +# this line must be at below of thus, because of... +include ../../Common/common.Makefile + +ifneq ($(MAKECMDGOALS), clean) +ifneq ($(MAKECMDGOALS), cleanall) +ifneq ($(notdir $(DEPEND_LIB)), $(wildcard $(DEPEND_LIB))) +$(shell $(CP) $(DEPEND_LIB) ./) +endif +endif +endif + +ifeq ($(MAKECMDGOALS), ) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +else +ifeq ($(MAKECMDGOALS), all) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +endif +endif +