Author Topic: Problem with Custom MakeFile  (Read 7321 times)

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Problem with Custom MakeFile
« on: October 25, 2010, 01:55:47 pm »
Hi,
I am trying to compile some code on Windows 7 using code-blocks 10.05.
While building the code,I get the error:
Code
Running command: mingw32-make.exe -f Makefile Debug
mingw32-make.exe: *** No rule to make target `Debug'.  Stop.
Process terminated with status 2 (5 minutes, 32 seconds)
0 errors, 1 warnings

But exe is built,inspite of the error. The only problem is,I am unable to debug the code,as it doesnt halt at any of the breakpoints. Please help.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Problem with Custom MakeFile
« Reply #1 on: October 25, 2010, 01:59:49 pm »
Why are you starting second thread?

There is a way to modify the parameters sent to make, see Project -> Build options -> One of the last tabs (it could be hidden)...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Problem with Custom MakeFile
« Reply #2 on: October 25, 2010, 02:22:20 pm »
I started a new thread coz the original question has changed slightly.
I have given the command
Code
make
make package-win32-base-debug
in pre build steps in build options.

And in the last tab of build options I have kept the Build file/target blank.

This was working perfectly fine earlier and I could successfully debug. I just cant figure out what is it that I changed , tht now my debugger doesnt work .
And also,howcome exe is built perfectly well,just debug isnt working.
« Last Edit: October 25, 2010, 02:25:01 pm by binnyshah »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Problem with Custom MakeFile
« Reply #3 on: October 25, 2010, 03:03:32 pm »
Why are you running make in pre build step?
Pre-build steps are for coping files an preparing the build...

Have you looked in the output of make? Does it used -g when compiling? Does it use strip to remove the debug info?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Problem with Custom MakeFile
« Reply #4 on: October 26, 2010, 11:21:15 am »
I have now removed make command from pre build steps and added it in Build Options->Make Target. Now I am not getting any error in build. But still Debug isnt working :(.

The end of Build Log looks something like this
Code
for i in "" ./vlc-1.1.0-rc3/*.dll \
           ./vlc-1.1.0-rc3/*.exe \
           ./vlc-1.1.0-rc3/activex/*.dll \
           ./vlc-1.1.0-rc3/mozilla/*.dll \
           ./vlc-1.1.0-rc3/plugins/*.dll \
; do \
 if test -n "$i" ; then \
   objcopy --only-keep-debug "$i" "$i.dbg"; \
   objcopy --strip-all "$i" ; \
   objcopy --add-gnu-debuglink="$i.dbg" "$i" ; \
   mv "$i.dbg" "./symbols-1.1.0-rc3"; \
 fi ; \
done
But in compiler and debugger settings I have neither checked -g option nor -s.
Please advice further.
« Last Edit: October 26, 2010, 11:30:37 am by binnyshah »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with Custom MakeFile
« Reply #5 on: October 26, 2010, 11:29:52 am »
If you use custom makefiles all settings are done bey the makefile.
You have to check carefully what paramters it needs and which targets it provides.
But it's up to you and can not be done by us and it's not the correct forum/website here to teach you how makefiles work in general.

The fact that you call the makefile from pre-build steps shows, that you do not really know what you do.

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Problem with Custom MakeFile
« Reply #6 on: October 26, 2010, 11:33:44 am »
That is true. But this make file worked perfectly fine earlier and I havent changed anything in it since then. Suddenly just the debugger is not working...evrything else is perfectly OK. It would be really helpful if by looking at the output you could advice me what went wrong. I am sorry if I am asking for a bit too much.

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Problem with Custom MakeFile
« Reply #7 on: October 26, 2010, 12:38:11 pm »
Please help here...There is absolutely no change in my make file....Earlier I could debug using the same but now the output says debugging symbols not found. Please help as this is really important for me.

Offline binnyshah

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Problem with Custom MakeFile
« Reply #8 on: October 26, 2010, 01:16:31 pm »
Thank you guys for all your help. My problem has got solved. You were right, I was using make command wrongly.
My make file had two options:package-win32-base or package-win32-base-debug.
I was using the former instead of latter by mistake and hence debug symbols were getting deleted.
Thanks a lot :)