all. Some of you who have helped me in the past might already know that my code is pretty messed up because of all of my #include statements including .cpp files. My question is, how am I supposed to correctly implement the make file to link everything together correctly?
What I currently have:
CC = g++
# Compiler flags:
# -g - debugging info.
# -Wall - used to turn on most compiler warnings.
CFLAGS = -g -Wall
# The build target
TARGET = icbins
# To bring exe up to date:
$(TARGET): main.o m1/cell.o m1/abstractions.o m1/expression.o m1/arithmetic.o m1/logic.o m1/cell.o m1/grid.o parsing/token.o parsing/lexer.o parsing/parser.o interface/icbins.o
$(CC) $(CFLAGS) -o $(TARGET) main.o m1/cell.o m1/abstractions.o m1/expression.o m1/arithmetic.o m1/logic.o m1/cell.o m1/grid.o parsing/token.o -lncurses
main.o: main.cpp
$(CC) $(CFLAGS) -c main.cpp
clean:
$(RM) $(TARGET)
Yeeeah. not the best. I don't really know what I am doing with this, so any help is appreciated. My current folder structure:
project -
main.cpp
interface -
icbins.cpp
m1-
abstractions.cpp
arithmetic.cpp
cell.cpp
expression.cpp
grid.cpp
logic.cpp
parsing-
lexer.cpp
parser.cpp
token.cpp
types.h
The main.cpp is supposed to be the driver and ./icbins is the executable file.
My current makefile "works", but not well...