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 looking to refine it further and add a build and archive feature.
Question 1:
Why doesn't clean work?
Question 2:
For Archiving I plan on using
# tar cvzf *.o Othello
to archive, the .o and executable generated when compiled. Is this a good standard practice or is there a better way to do this?
Question 3:
For the build portion, I plan on running the executable using ./Othello is this best practice for build in a makefile?
The git repository is posted below thank you for your time
all: Othello
Othello: 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
rm MyOthello
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…