Makefile problem with Ubuntu "Hardy Heron"
- From: thomas.mertes@xxxxxx
- Date: Tue, 13 May 2008 06:30:24 -0700 (PDT)
Hello
I got a report that my makefile has problems with Ubuntu
"Hardy Heron". I use Ubuntu 8.04 LTS and do not see this problem.
My makefile contains some echo commands which create a file which is
compiled with the C compiler afterwards. The executable is used to
write something in my 'version.h' file. The following commands
are in my makefile (the leading tab is omited):
echo "#include \"stdio.h\"" > chkshift.c
echo "int main (int argc, char **argv)" >> chkshift.c
echo "{" >> chkshift.c
echo "long number;" >> chkshift.c
echo "number = -1;" >> chkshift.c
echo "if (number >> 1 == (long) -1) {" >> chkshift.c
echo "printf(\"\043define RSHIFT_DOES_SIGN_EXTEND\n\");" >> chkshift.c
echo "}" >> chkshift.c
echo "return 0;" >> chkshift.c
echo "}" >> chkshift.c
$(CC) chkshift.c -o chkshift
../chkshift >> version.h
rm chkshift.c
rm chkshift
On my machine this works without problems, while under "Hardy Heron"
it seems to produce the following error.
chkshift.c:7:8: warning: missing terminating " character
chkshift.c: In function 'main':
chkshift.c:7: error: missing terminating " character
chkshift.c:8:1: warning: missing terminating " character
chkshift.c:8: error: missing terminating " character
chkshift.c:9: error: expected expression before '}' token
chkshift.c:9: error: expected ';' before '}' token
make: *** [version.h] Error 1
I did get this report, but I don't know (at the moment) how the
file chkshift.c looks like (I also have currently no information
about the make, gcc and bash versions used). It would be helpful
if someone could try the commands above (under "Hardy Heron") and
tell me how the file chkshift.c looks like.
The problem seems to be the line
echo "printf(\"\043define RSHIFT_DOES_SIGN_EXTEND\n\");" >> chkshift.c
I have suggested to use
echo "printf(\"#define RSHIFT_DOES_SIGN_EXTEND\n\");" >> chkshift.c
(instead of \043 I use # ) or
echo 'printf("#define RSHIFT_DOES_SIGN_EXTEND\n");' >> chkshift.c
(the outer " were replaced by ' and the \" were replaced by \ ).
Can anyone with "Hardy Heron" (other versions/distributions would be
also interesting) tell me what alternative works on his/her machine.
Thanks in advance.
Greetings Thomas Mertes
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.
.
- Follow-Ups:
- Re: Makefile problem with Ubuntu "Hardy Heron"
- From: Arnold Hendriks
- Re: Makefile problem with Ubuntu "Hardy Heron"
- From: Jens Thoms Toerring
- Re: Makefile problem with Ubuntu "Hardy Heron"
- Prev by Date: Re: Changing pre-login prompt
- Next by Date: Re: Makefile problem with Ubuntu "Hardy Heron"
- Previous by thread: webcam init and getImage
- Next by thread: Re: Makefile problem with Ubuntu "Hardy Heron"
- Index(es):
Relevant Pages
|