commit 9218754f23f81b6bfdd9108e83568a53cdc079b2 Author: Luke Date: Sun Apr 3 17:50:02 2022 -0700 Sane defaults diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..32e6af6 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,20 @@ +{ + "env": { + "defaultIncludePath": [ + "${workspaceFolder}/src" + ], + }, + "configurations": [ + { + "name": "Luker", + "includePath": [ + "${defaultIncludePath}" + ], + "intelliSenseMode": "linux-gcc-x64", + "compilerPath": "/usr/bin/g++", + "cStandard": "gnu17", + "cppStandard": "gnu++14" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..b1dc085 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) build and debug project", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/main", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}/build", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "C/C++: g++ build workspace project" + } + + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..4f7fd6f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + "tasks": [ + { + "type": "shell", + "label": "C/C++: g++ build workspace project", + "command": "${workspaceFolder}/build.sh", + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": "$gcc", + "detail": "compiler: /usr/bin/g++" + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a4afd11 --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +mkdir -p build + +if [[ ! -e build/res ]]; then + ln -s ../res build/res +fi + +g++ -g -fdiagnostics-color=always \ + -Isrc \ + src/*.cpp \ + mybox.cpp \ + -o build/main + diff --git a/mybox.code-workspace b/mybox.code-workspace new file mode 100644 index 0000000..ef9f5d2 --- /dev/null +++ b/mybox.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file diff --git a/mybox.cpp b/mybox.cpp new file mode 100644 index 0000000..a851ff0 --- /dev/null +++ b/mybox.cpp @@ -0,0 +1,11 @@ + + +#include +#include + +#include + +int main(void) { + printf("hello world\n"); + mysub(); +} \ No newline at end of file diff --git a/src/sub.cpp b/src/sub.cpp new file mode 100644 index 0000000..73a706f --- /dev/null +++ b/src/sub.cpp @@ -0,0 +1,6 @@ +#include + +void mysub() { + printf("hello subroutine\n"); +} + diff --git a/src/sub.h b/src/sub.h new file mode 100644 index 0000000..0e1bc87 --- /dev/null +++ b/src/sub.h @@ -0,0 +1,6 @@ +#ifndef H__LPR_SUB +#define H__LPR_SUB + +void mysub(); + +#endif