提交 e2a5f915 创建 作者: 王晓庆's avatar 王晓庆

11

上级 d0e74878
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/application.exe",
"targetArchitecture": "x86",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "生成项目(make)",
"MIMode": "gdb",
"miDebuggerPath": "${execPath}.toolchain\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
{
"files.exclude": {
}
}
{
"version": "2.0.0",
"tasks": [
{
"label": "生成项目(make)",
"type": "shell",
"windows": {
"command": "cmd.exe /c echo VSCode安装路径-${execPath} ; echo ''; echo 正在使用makefile文件生成项目 ; echo ''; make",
"options": {
"env": {
"PATH": "${execPath}.toolchain\\bin;${execPath}.mingw64\\bin;${env:PATH}"
}
}
},
"args": [],
"group": "build",
"presentation": {
"reveal": "always",
"group": "make"
},
"problemMatcher": "$gcc"
},
{
"label": "清理项目(make clean)",
"type": "shell",
"windows": {
"command": "cmd.exe /c echo VSCode安装路径-${execPath} ; echo ''; echo 正在使用makefile文件清理项目 ; echo ''; make clean",
"options": {
"env": {
"PATH": "${execPath}.toolchain\\bin;${execPath}.mingw64\\bin;${env:PATH}"
}
}
},
"args": [],
"group": "build",
"presentation": {
"reveal": "always",
"group": "clean"
},
"problemMatcher": "$gcc"
}
]
}
/* 定义控制台应用程序的入口点 */
#include "console.h"
int main(int argc, char* argv[])
{
/* TODO: 在此处添加自己的代码 */
printf("Hello world!\n");
return 0;
}
#ifndef _CONSOLE_H_
#define _CONSOLE_H_
#include <stdio.h>
/* TODO: 在此处引用程序需要的其他头文件 */
#endif /* _CONSOLE_H_ */
DIR_INC = .
DIR_SRC = .
DIR_OBJ = .
DIR_BIN = .
SRC = $(wildcard ${DIR_SRC}/*.c)
OBJ = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))
TARGET = application.exe
BIN_TARGET = ${DIR_BIN}/${TARGET}
CC = gcc
CFLAGS = -g -w -std=c99 -fsigned-char -I${DIR_INC}
${BIN_TARGET}:${OBJ}
@echo --- build executable file: $@
$(CC) $(OBJ) -o $@
${DIR_OBJ}/%.o:${DIR_SRC}/%.c
@echo --- build object file: $@
$(CC) $(CFLAGS) -c $< -o $@
clean:
del /Q *.exe *.o
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论