I am new to using makefiles. I have four files and one of them is a header file. And i want to write the command in the terminal: make do nu=20. This should compile all the files and the c++ program whereas nu=20 is for the argc and argv variables in the main function.
But errors occur, that is they aren't linking properly. Here's the makefile Sorry, for mistakes, but i am pretty new to this stuff. How should it really be written?
nu = 15
main.o: main.cpp ballbounce.h threads.cpp GUI.cpp
g++ -c main.cpp
threads.o: threads.cpp ballbounce.h main.cpp GUI.cpp
g++ -c threads.cpp
GUI.o: GUI.cpp ball.h main.cpp threads.cpp
g++ -c GUI.cpp
run: main.o threads.o GUI.o ball.h
g++ -o run main.o threads.o GUI.o
do: run
./run $(nu)
clean:
rm main.o threads.o GUI.o run