Background:
I am relatively new to Make and I started building a makefile for my Othello game I recently built. My current makefile is relatively simple. Yet I am lo
For a single folder project I built this Makefile *Note the executable generated has been changed to Game
all: build archive
build: Game
Game: main.o Myothello.o space.o game.o
clang++ main.o Myothello.o space.o game.o -o Othello
main.o: main.cc
clang++ -c main.cc
game.o: game.cc
clang++ -c game.cc
Myothello.o: Myothello.cc
clang++ -c Myothello.cc
space.o: space.cc
clang++ -c space.cc
clean:
rm -f *.o core *.core
archive: main.cc game.cc Myothello.cc space.cc char.h colors.h game.h
space.h Myothello.h makefile
tar -cf archive.tar main.cc game.cc Myothello.cc space.cc char.h
colors.h game.h space.h Myothello.h makefile
This works assuming all of your files are in the same directory This is where I found my information
http://www.tutorialspoint.com/makefile/makefile_example.htm
https://www.tecmint.com/18-tar-command-examples-in-linux/
https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html
ftp://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_toc.html