删除了例子,开始正式设计

重新设计的编译流程
This commit is contained in:
jackfiled 2022-05-04 22:44:47 +08:00
parent 2e5ca0e8db
commit 3d07326a12
9 changed files with 60 additions and 41 deletions

View File

@ -12,9 +12,7 @@ include_directories(
${PROJECT_SOURCE_DIR}/include/ ${PROJECT_SOURCE_DIR}/include/
) )
add_subdirectory(lib) aux_source_directory(./src SRC)
# #
add_executable(bus main.c) add_executable(bus main.c ${SRC})
target_link_libraries(bus bus_lib)

22
include/bus.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef AUTO_PILOT_BUS_BUS_H
#define AUTO_PILOT_BUS_BUS_H
#include "rail.h"
struct {
/**
*
*/
rail_node_t* rail_node_pos;
/**
*
*/
int distance;
} bus;
/**
*
*/
typedef struct bus bus_t;
#endif //AUTO_PILOT_BUS_BUS_H

View File

@ -1,11 +0,0 @@
//
// Created by ricardo on 2022/4/29.
//
#ifndef AUTO_PILOT_BUS_EXAMPLE_H
#define AUTO_PILOT_BUS_EXAMPLE_H
#include "stdio.h"
void print(char* str);
#endif //AUTO_PILOT_BUS_EXAMPLE_H

32
include/rail.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef AUTO_PILOT_BUS_RAIL_H
#define AUTO_PILOT_BUS_RAIL_H
struct {
/**
*
*/
int id;
/**
*
*/
int last_node_distance;
/**
*
*/
int next_node_distance;
/**
*
*/
struct rail_node* last_node;
/**
*
*/
struct rail_node* next_node;
} rail_node;
/**
*
*/
typedef struct rail_node rail_node_t;
#endif //AUTO_PILOT_BUS_RAIL_H

View File

@ -1,5 +0,0 @@
aux_source_directory(. LIB_SRCS)
include_directories(../include)
add_library(bus_lib ${LIB_SRCS})

View File

@ -1,14 +0,0 @@
//
// Created by ricardo on 2022/4/29.
//
#include "example.h"
/**
* @brief stdin打印一个字符串
*
* @param str
*/
void print(char* str)
{
printf("%s", str);
}

9
main.c
View File

@ -1,4 +1,4 @@
#include "example.h" #include "stdio.h"
/** /**
* @brief * @brief
@ -7,11 +7,6 @@
*/ */
int main() int main()
{ {
/** printf("同志们加油啊,不然要寄啦!\n");
* @brief
*
*/
char* string = "Good morning!\n";
print(string);
return 0; return 0;
} }

1
src/bus.c Normal file
View File

@ -0,0 +1 @@
#include "bus.h"

1
src/rail.c Normal file
View File

@ -0,0 +1 @@
#include "rail.h"