gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > GNU make vs shell commands

#16103 - Cearn - Sun Feb 08, 2004 1:58 pm

I'm using Visual C++ and devkit advance v4 to compile my GBA projects. The compilation & linking part works just fine, but when I try to use other
commands like "rm" and "cd" do I run into problems.

For example, to clean all the object and executable files (using the well-known wildcard character '*') I use something like
Code:
SRCDIR= ./examples

.PHONY : clean_all
clean_all:
   rm -fv $(SRCDIR)/*.o $(SRCDIR)/*.elf $(SRCDIR)/*.gba

It's supposed to remove all ".o", ".elf" and ".gba" files, but all I get is
Code:
/bin/sh: command not found


The project is set up to use the GNU make from DKA v4 instead of Visual C's NMAKE, so the forward slashes aren't the problem.
I do have a working "rm" command. If I fill in the files manually everything works fine. Somehow it's the '*' character messes the whole thing up. But only if I use a makefile, from the command line the command does what it's supposed to do.
This problem is not limited to "rm"; other commands don't like '*' in their arguments either. But I've seen people use them in their make files, so I know it's possible. Anyone know why they don't work in my case?

#16104 - tepples - Sun Feb 08, 2004 2:42 pm

It appears that if you use the Cygwin make, you need the Cygwin shell installed. For a more Windows-friendly make, try the MinGW make.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#16105 - Cearn - Sun Feb 08, 2004 2:55 pm

I was wondering whether cygwin had anything to do with it. Thanks for clearing that up.
But about MinGW, uhm, I'd like to give it a try but apparently http://www.rmitton.com/gbacc/ (which gbadev.org links to) doesn't have it any more :(.
Edit: Nevermind, www.mingw.org. Duh.

Also, how would I tell my makefiles to use the MinGW shell? I assume it won't do so automatically.

And I'd still like to know why it chokes on a '*' character.

#16106 - tepples - Sun Feb 08, 2004 3:16 pm

Things to remember:
  • MinGW's make is named mingw32-make as opposed to make.
  • If you put MinGW in front of DevKit Advance in your PATH for compiling native tools, you'll want to use arm-agb-elf-gcc etc. for compiling GBA code.
  • You may want to switch to MinGW-based DevKit Advance R5 beta 3.

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#16107 - Paul Shirley - Sun Feb 08, 2004 3:27 pm

removed

Last edited by Paul Shirley on Sun Mar 28, 2004 9:14 pm; edited 1 time in total

#16108 - Cearn - Sun Feb 08, 2004 3:58 pm

Quote:
Code:
SHELL= /bin/sh

That simple huh? I'll try that then.
But in the end I suppose I should switch to R5 beta 3 one of these days. Too bad there's no simple setup.exe like there is for v4, now I have to figure out how to set it up myself. But it's not like that's ever caused anyone any problems, right? :/