Author Topic: How to represent a Makefile variable in CB  (Read 4023 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2784
How to represent a Makefile variable in CB
« on: February 03, 2007, 02:46:20 am »
I have a makefile with the following line:

pkgdatadir = $(datadir)/cgdb

and a C file with the following line:

fs_util_get_path (PKGDATADIR, "cgdb.txt", cgdb_help_file);

This compiles with the Makefile, but not in CB when I try to enter it in compile defines as PKGDATADIR=/home/pecan

How do you do this?

Code
-------------- Build: cgdb in cgdb ---------------
gcc-4.0 -Wall -g -DHAVE_CONFIG_H -DPKGDATADIR=/home/pecan/proj/cgdb/ -DPKGLIBDIR=/home/pecan/proj/cgdb/ -DPKGINCLUDEDIR=/home/pecan/proj/cgdb/ -Wall -g  -Icgdb/lib/kui/inc -Ivarious/adt/include -Ivarious/util/include -I/home/pecan/proj/cgdb -Icgdb/include -Ivarious/rline/include -Icgdb/include -Icgdb/tokenizer/include -Itgdb/tgdb-base/include -I/usr/include  -c /home/pecan/proj/cgdb/cgdb/src/interface.c -o .obj/cgdb/src/interface.o
/home/pecan/proj/cgdb/cgdb/src/interface.c: In function 'if_display_help':
/home/pecan/proj/cgdb/cgdb/src/interface.c:1534: error: syntax error before '/' token
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: How to represent a Makefile variable in CB
« Reply #1 on: February 03, 2007, 10:01:23 am »
Try PKGDATADIR="\"/home/pecan/proj/cgdb/\"".
Be patient!
This bug will be fixed soon...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2784
Re: How to represent a Makefile variable in CB
« Reply #2 on: February 03, 2007, 03:45:20 pm »
Try PKGDATADIR="\"/home/pecan/proj/cgdb/\"".

Thanks, I tried it, but this must be some sort of gcc-4.0 error. It should work, but doesn't.
Thanks for the suggestion.

I don't think I want to battle this any more.
I'll just hard code it and move on to understanding how pseudo-terminals work.

I'm not planning on living with this code anyway. I just want to port the concept to CB. But it does tell me, in future, not to do such a thing in a CB project.
Code
-------------- Build: cgdb in cgdb ---------------
gcc-4.0 -Wall -g -DHAVE_CONFIG_H -DPKGDATADIR="\"/home/pecan/proj/cgdb/doc\"" -DPKGLIBDIR=/home/pecan/proj/cgdb/ -DPKGINCLUDEDIR=/home/pecan/proj/cgdb/ -Wall -g  -Icgdb/lib/kui/inc -Ivarious/adt/include -Ivarious/util/include -I/home/pecan/proj/cgdb -Icgdb/include -Ivarious/rline/include -Icgdb/include -Icgdb/tokenizer/include -Itgdb/tgdb-base/include -I/usr/include  -c /home/pecan/proj/cgdb/cgdb/src/interface.c -o .obj/cgdb/src/interface.o
/home/pecan/proj/cgdb/cgdb/src/interface.c: In function 'if_display_help':
/home/pecan/proj/cgdb/cgdb/src/interface.c:1537: error: syntax error before '/' token
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings
 

« Last Edit: February 03, 2007, 03:55:16 pm by Pecan »