-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up basic example project and structure with Makefile
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vimrc | ||
*.swp | ||
bin/* | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# makefile modeled off of: http://hiltmon.com/blog/2013/07/03/a-simple-c-plus-plus-project-structure/ | ||
|
||
|
||
CC := g++ -std=c++14 | ||
SRCDIR := src | ||
BUILDDIR := build | ||
TARGET := build/runner | ||
|
||
SRCEXT := cpp | ||
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT)) # grabs all src files | ||
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o)) | ||
INC := -I include | ||
|
||
$(TARGET): $(OBJECTS) | ||
@echo " Linking..." | ||
@echo " $(CC) $^ -o $(TARGET)"; $(CC) $^ -o $(TARGET) | ||
|
||
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT) | ||
@mkdir -p $(BUILDDIR) | ||
@echo " $(CC) $(INC) -c -o $@ $<"; $(CC) $(INC) -c -o $@ $< | ||
|
||
clean: | ||
@echo " Cleaning..."; | ||
@echo " $(RM) -r $(BULIDDIR) $(TARGET)"; $(RM) -r $(BULIDDIR) $(TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# Checkers AI Project | ||
|
||
This is the repo for a checkers AI project. | ||
|
||
## Project Structure | ||
|
||
* `src/` | ||
- contains .cpp source files | ||
* `include/` | ||
- contains all .h header files | ||
* `bin/` | ||
- all object files are dumped in here (clean commands cleans this directory up) | ||
* `build/runner` | ||
- When project is built it's compiled to the `runner` file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef MOVE_H | ||
#define MOVE_H | ||
|
||
#include <vector> | ||
|
||
class Move | ||
{ | ||
private: | ||
|
||
std::vector<int> moves; | ||
|
||
public: | ||
|
||
Move() : moves() {}; | ||
void printMessage(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <iostream> | ||
#include "Move.h" | ||
|
||
void Move::printMessage() | ||
{ | ||
std::cout << "Here is an example message" << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
|
||
int main(int argc, const char * argv[]) { | ||
std::cout << "Hello world!" << std::endl; | ||
return 0; | ||
} |