Skip to content
Snippets Groups Projects
Commit 46051045 authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Initial commit

parents
Branches
No related merge requests found
#EditorConfig
http://EditorConfig.org
# Top-most EditorConfig File.
root = true
# Unix-style newlines with a newline ending every file.
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set properties for most file types.
[*.{css,scss,py,js,json,php,jar,c,sh}]
# Set character encoding
charset = utf-8
# Set tabbing styles.
indent_style = space
indent_size = 4
# Set properties for html.
[*.{html,blade.php}]
# Set character encoding
charset = utf-8
# Set tabbing styles.
indent_style = space
indent_size = 2
# Do not track local environment settings/solution.
.vscode/
.idea/
.vs/
# Ignore compiled files.
*.out
File added
# Documents > References
## Description
All references to external logic.
Includes anything from stack overflow links to notes about logic from previous works.
## References
### Makefile
* Purpose of ".PHONY" - <https://stackoverflow.com/a/2145605>
* Have one command execute another - <https://stackoverflow.com/a/48552668>
* Surpress output messages - <https://stackoverflow.com/a/3148530>
main.c 0 → 100755
/**
*
*/
// Import headers.
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Constant Defines.
// Variable Declaration.
// Method Declaration.
/**
* Program's main.
* Initializes and runs program.
*/
int main(int argc, char* argv[]) {
printf("Starting program.\n");
printf("\n\nTerminating program.\n");
}
makefile 0 → 100755
# Tell makefile to use commands define here, if file with same name exists.
.PHONY: all compile run valgrind clean
# Set default if none is specified.
default: valgrind clean
# Fully build and execute project.
all: compile run clean
# Compile program.
compile:
gcc -Wall -Wpedantic -std=c99 *.c
# Compile and run program.
run: compile
./a.out
# Compile program and run with valgrind (memory checking).
valgrind: compile
valgrind --leak-check=full ./a.out
# Clean up directory.
clean:
@rm -f *.o
@rm -f a.out
# Display help output.
help:
@echo "Default: Executes \"valgrind\", then \"clean\"."
@echo ""
@echo "Available Commands:"
@echo " all - Executes \"run\", then \"clean\"."
@echo " run - Compile program to \"a.out\". Then run."
@echo " valgrind - Compile program to \"a.out\". Then run with memory error checking."
@echo " clean - Remove temporary/compiled files from directory."
# C - Dining Philosopher Threads
## Description
A program using pthreads to do the "Dining Philosophers" problem.
## Running Program
Open a terminal and cd to project root.<br>
For a list of available makefile commands, run `make help`.<br>
In a terminal, run `make <command_here>`.
## References
See `documents/references.md`.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment