Fix project structure and add make file

This commit is contained in:
Garrett Dickinson 2022-02-09 13:17:13 -06:00
parent f014088199
commit 2d9d56be76
9 changed files with 23 additions and 3 deletions

BIN
cobalt Executable file

Binary file not shown.

20
makefile Normal file
View File

@ -0,0 +1,20 @@
#OBJS specifies which files to compile as part of the project
OBJS = $(wildcard src/*.cpp)
#CC specifies which compiler we're using
CC = g++
#COMPILER_FLAGS specifies the additional compilation options we're using
# -w suppresses all warnings
COMPILER_FLAGS = -w
#LINKER_FLAGS specifies the libraries we're linking against
LINKER_FLAGS =
#OBJ_NAME specifies the name of our exectuable
OBJ_NAME = cobalt
#This is the target that compiles our executable
all : $(OBJS)
$(CC) $(OBJS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "lexer.h"
#include "../include/lexer.h"
char c;
FILE* input_file;

View File

@ -2,7 +2,7 @@
#include <iostream>
#include <vector>
#include "lexer.h"
#include "../include/lexer.h"
int main(int argc, char *argv[]) {
if (argc > 1) {

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <iostream>
#include "parser.h"
#include "../include/parser.h"
Parser::Parser(std::string input_file) {