mikeizbicki / ucr-cs100

open source software construction course
Other
485 stars 407 forks source link

makefile help #32

Closed willccoates closed 10 years ago

willccoates commented 10 years ago

i am so confused on what to do inside the makefile, i know its late but ive never made one before and ive looked at tutorials online and not found them very helpful

willccoates commented 10 years ago

so far i just have all: g++ -Wall -Werror -ansi -pedantic main.cpp -o ./bin/rshell rshell: g++ -Wall -Werror -ansi -pedantic main.cpp -o ./bin/rshell

DanTheTingler commented 10 years ago

in your all, you're supposed to call rshell. so all should look like all: rshell

other than that, everything looks fine!

willccoates commented 10 years ago

so get ride of the statement inside of all? and also it says that the makefile needs to be in the root folder what exactly does this mean?

DanTheTingler commented 10 years ago

yep! and hmm i'm not too sure, but i think the makefile needs to be in your rshell folder. also, instead of main.cpp it should be src/main.cpp, since that's where your main.cpp file should be. that might fix the problem!

willccoates commented 10 years ago

so we need a src file and a rshell folder, is the src folder in the rshell folder? and in the src goes main.cpp and in the rshell goes the license, Makefile, and readme right? thank you very much for your help

willccoates commented 10 years ago

i have it set up so it is rshell: inside rshell is src,Makefile, README.md, and license src: main.cpp when i run make from rshell i get the error "make: *\ No rule to make target rhsell', needed byall'. Stop." with my makefile being 1 all: rhsell 2 rshell: 3 g++ -Wall -Werror -ansi -pedantic src/main.cpp -o ./bin/rshell

willccoates commented 10 years ago

i fixed the error on line 1 also and still get the error

DanTheTingler commented 10 years ago

By you fixing the error on line 1 are you saying you fixed the rshell spelling error? If not, fix that, and see if it works.

willccoates commented 10 years ago

i created a bin folder and it only ran when i typed -make rshell -bin/rshell i know that i need to only type make tho, any ideas on what to change in my makefile?

DanTheTingler commented 10 years ago

Otherwise your main file looks fine to me, and it might be a problem with your set-up.

willccoates commented 10 years ago

yes i fixed the typo, but it still does not work unless i type make rshell