parent
4f2171276f
commit
3c5d00285b
|
@ -370,6 +370,7 @@ PLAT_LINUX_OBJS :=
|
|||
PLAT_LINUX_DEPS :=
|
||||
endif
|
||||
|
||||
$(info objects:[$(PLAT_LINUX_OBJS)])
|
||||
# 构建系统最终需要生成的目标,包含 ARM64 和 Linux 平台
|
||||
ALL_OBJS += $(PLAT_ARM64_OBJS) $(PLAT_LINUX_OBJS)
|
||||
ALL_DEPS += $(PLAT_ARM64_DEPS) $(PLAT_LINUX_DEPS)
|
||||
|
|
6
Makefile
6
Makefile
|
@ -34,14 +34,16 @@ all: demo conntrack netlink trace
|
|||
|
||||
ifeq ($(OPT), install)
|
||||
#$(shell `find ../release -name "*.zip" -delete`)
|
||||
else ifeq ($(OPT), clean)
|
||||
#
|
||||
else
|
||||
$(shell chmod +x ./build_env.sh && ./build_env.sh)
|
||||
endif
|
||||
|
||||
ifeq ($(OPT), clean)
|
||||
#
|
||||
endif
|
||||
|
||||
$(shell chmod +x ./build_env.sh)
|
||||
$(shell test -e ./Common/compile.h || ./build_env.sh)
|
||||
|
||||
demo:
|
||||
ifeq ($(OPT), clean)
|
||||
|
|
|
@ -21,18 +21,22 @@ DEBUG = TRUE
|
|||
PLAT_LINUX ?= TRUE
|
||||
PLAT_ARM64 ?= TRUE
|
||||
|
||||
VPATH = ../user/demo
|
||||
SRC_DIR = ../user/demo
|
||||
|
||||
VPATH = $(SRC_DIR)
|
||||
|
||||
# source code
|
||||
|
||||
# set the source file, don't used .o because of ...
|
||||
# MRS Board Source Files
|
||||
PLAT_LINUX_SRCS := main.c version.c
|
||||
# Linux Board Source Files
|
||||
PLAT_LINUX_SRCS := $(subst $(SRC_DIR)/, , $(wildcard $(SRC_DIR)/*.c))
|
||||
#main.c version.c
|
||||
PLAT_ARM64_SRCS := $(PLAT_LINUX_SRCS)
|
||||
|
||||
# gcc CFLAGS
|
||||
PLAT_LINUX_CFLAGS += -DVERSION=\"v0.0.0.1\"
|
||||
PLAT_ARM64_CFLAGS += -DVERSION=\"v0.0.0.1\"
|
||||
COMMON_CFLAGS := -I../../Common
|
||||
PLAT_LINUX_CFLAGS += $(COMMON_CFLAGS)
|
||||
PLAT_ARM64_CFLAGS += $(COMMON_CFLAGS)
|
||||
|
||||
# this line must be at below of thus, because of...
|
||||
include ../../Common/common.Makefile
|
||||
|
|
|
@ -1,9 +1,45 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
extern const char* get_version(void);
|
||||
#include "compile.h"
|
||||
|
||||
/**
|
||||
* @brief 应用程序主函数
|
||||
* @note
|
||||
* @param argc: 输入参数个数
|
||||
* @param **argv: 输入参数详细内容
|
||||
* @retval 0
|
||||
*/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
fprintf(stdout, "Hello vBRAS Product user demo version: %ld\n", get_version());
|
||||
return 0;
|
||||
int c, optidx = 0;
|
||||
opterr = 0;
|
||||
static struct option long_opts[] = {
|
||||
{ "help", 0, 0, 'h' },
|
||||
{ "version", 0, 0, 'v' },
|
||||
// TODO 添加其它需要处理的参数配置
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
while((c = getopt_long(argc, argv, "hv", long_opts, &optidx)) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'v':
|
||||
fprintf(stdout, "User demo version: %s(%s)\n", sGATE_GIT_TAGS, sGATE_GIT_VERS);
|
||||
break;
|
||||
//TODO 添加其它必要处理参数过程
|
||||
|
||||
case '?':
|
||||
case 'h':
|
||||
fprintf(stdout, "Usage: %s [-h] [-v] ...\n", argv[0]);
|
||||
fprintf(stdout, "options:\n");
|
||||
fprintf(stdout, "\t-v, --version show program version\n");
|
||||
fprintf(stdout, "\t-h, --help print this message\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue