Makefile problem with Ubuntu "Hardy Heron"



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.
.



Relevant Pages

  • Re: Unable to use Ubuntu 8.04 live CD
    ... at least with the "Live CDs" version of Ubuntu 8.04 Hardy Heron. ... I never could get the live CDs to install properly, except to another computer by devoting the whole HD to Ubuntu. ... Yes I would like to file a bug report and would certainly appreciate your help. ...
    (Ubuntu)
  • Re: Sound unter Hardy Heron
    ... Gutsy Gibbon ist definitiv dem Hardy Heron vorzuziehen, wenn es denn Ubuntu sein muß. ... Aber so ziemlich alle Threads, die Du angestoßen hattest, waren nicht "kleine Spötteleien", sondern Trollgehabe. ...
    (de.comp.os.unix.linux.misc)
  • Re: Unable to use Ubuntu 8.04 live CD
    ... at least with the "Live CDs" version of Ubuntu 8.04 Hardy Heron. ... I never could get the live CDs to install properly, except to another computer by devoting the whole HD to Ubuntu. ... Before filing a bug report, I did try something else which allowed me to install to a partition rather than the whole HD, as I did on another machine. ...
    (Ubuntu)
  • Re: Brightness control
    ... Ubuntu 8.04.1 LTS (Hardy Heron), which used to work fine with ... Message from icon in panel reads: ... "cannot get laptop panel brightness" ...
    (Ubuntu)