Closed willccoates closed 10 years ago
you need a tab after the bin, so:
all: bin rshell
bin:
[! -d bin] && mkdir bin
yea i have that in my Makefile
I had to put a dollar sign before the bin in the brackets like [ ! -d $bin ] && mkdir bin
i just tried it and i still got the same error :/
maybe you need a space between the bracket and the exclamation point ?
ahh idk whats wrong with it lol
lol well if it helps mine looks like this, idk what could be wrong though :
all: bin rshell ls
bin: [ ! -d $bin ] && mkdir bin
Please paste the exact contents of the file here. Put it inside of three
backticks so that github displays it as code. Lookup "github flavored
markdown" if you need a tutorial on how to do this. Also, put the exact
error message you get when you run make
. I mean EVERYTHING, including
the command prompt and the stuff you type in.
On Mon, Aug 18, 2014 at 8:04 PM, william coates notifications@github.com wrote:
ahh idk whats wrong with it lol
Reply to this email directly or view it on GitHub https://github.com/mikeizbicki/ucr-cs100/issues/81#issuecomment-52585090 .
1 all: bin rshell
2 bin:
3 [ ! -d bin] && mkdir bin
4 rshell:
5 g++ -Wall -Werror -ansi -pedantic src/main.cpp -o ./bin/rshell
6 ls:
7 g++ -Wall -Werror -ansi -pedantic src/ls.cpp -o ./bin/ls
8 cp:
9 g++ -Wall -Werror -ansi -pedantic src/cp.cpp -o ./bin/cp
william@william-Inspiron-N5110:~/cs100/hw12/rshell$ make
[ ! -d bin] && mkdir bin
/bin/sh: 1: [: missing ]
make: *** [bin] Error 2
william@william-Inspiron-N5110:~/cs100/hw12/rshell$
You need a space between bin
and ]
. The [
executable expects its last parameter to be ]
, but it's last parameter in your version is bin]
.
that worked! thank you
i tried adding the code
all: bin rshell bin: [! -d bin] && mkdir bin
and i got the error
[! -d bin] && mkdir bin /bin/sh: 1: [!: not found make: *\ [bin] Error 127
could anyone explain what i need to fix