🎉 feat(init repo): first update the repo
初次提交仓库 1. 添加源文件和仓库的必要配置文件 2. 添加readme end of segment
This commit is contained in:
commit
bffcf038e7
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
build/
|
||||
bin/
|
||||
obj/
|
||||
.vscode/
|
||||
*.o
|
||||
0
cmd_decoder.c
Normal file
0
cmd_decoder.c
Normal file
38
cmd_decoder.h
Normal file
38
cmd_decoder.h
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file cmd_decoder.h
|
||||
* @author impressionyang (impressionyang@outlook.com)
|
||||
* @brief 字符串命令解析器的头文件
|
||||
* @version 0.1
|
||||
* @date 2022-08-23
|
||||
*
|
||||
* @copyright Copyright (c) 2022 impressionyang
|
||||
*
|
||||
* @par 修改日志:
|
||||
* <table>
|
||||
* <tr><th>Date <th>Version <th>Author <th>Description
|
||||
* <tr><td>2022-08-23 <td>v1.0 <td>impressionyang <td>内容
|
||||
* </table>
|
||||
*/
|
||||
#ifndef __CMD_DECODER_H__
|
||||
#define __CMD_DECODER_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus ///<use C compiler
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct _cmd_decoder_
|
||||
{
|
||||
/// 使能标志,确定是否进行了初始化
|
||||
uint8_t enable;
|
||||
|
||||
} cmd_decoder_t, *cmd_decoder_t_p;
|
||||
|
||||
|
||||
#ifdef __cplusplus ///<end extern c
|
||||
}
|
||||
#endif
|
||||
#endif//__CMD_DECODER_H__
|
||||
31
cmd_decoder_makefile
Normal file
31
cmd_decoder_makefile
Normal file
@ -0,0 +1,31 @@
|
||||
INC = -I../more_string
|
||||
LIB =
|
||||
CFLAGS =
|
||||
DIR_OBJS = ./obj
|
||||
DIR_BIN = ./bin
|
||||
|
||||
dirs := $(DIR_OBJS) $(DIR_BIN)
|
||||
bin = more_string_example
|
||||
src = $(wildcard *.c)
|
||||
obj = $(patsubst %.c,%.o,$(src)) #patsubst模式字符替换函数 #obj = $(src:.c=.o)
|
||||
|
||||
obj := $(addprefix $(DIR_OBJS)/,$(obj))
|
||||
bin := $(addprefix $(DIR_BIN)/,$(bin))
|
||||
|
||||
#$@ 目标(自动变量)
|
||||
#$^ 依赖
|
||||
all: $(dirs) $(bin)
|
||||
|
||||
$(dirs):
|
||||
mkdir $@
|
||||
|
||||
$(bin):$(obj)
|
||||
gcc $^ -o $@ $(CFLAGS) $(INC) $(LIB)
|
||||
|
||||
$(DIR_OBJS)/%.o:%.c
|
||||
gcc $^ -o $@ -c $(CFLAGS) $(INC) $(LIB)
|
||||
|
||||
clean:
|
||||
rm -rf $(dirs) $(bin)
|
||||
|
||||
.PHONY:all clean
|
||||
Loading…
Reference in New Issue
Block a user