Questions about make -C in SunOS

I am using a SunOS to compile a project. The Makefile contains commands "$(MAKE) -C $$dir". However, in "man make" there is no -C option. I tried using MAKE=gmake but it failed too. My questions:

  1. The make options for this SunOS is different from the gnu make options. Is it because of the difference between the BSD make and GNU make, I wonder?

  2. Could I rewrite make -C $$dir as:
    cd dir; \
    make; \
    cd ..
    ?

Thanks.

gnumake man page does show a -C option.

Does the software require you use gnumake? If so, then you can probably get it at www.sunfreeware.com (listed under make-xxx (xxx=version)

Thanks for your reply.

> gnumake man page does show a -C option.

Yes, in

http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?make

I saw from "OPTIONS"

  -C dir
        Change to directory dir before reading  the  makefiles  or  doing
        anything  else.   If  multiple  -C options are specified, each is
        interpreted relative to the previous one: -C / -C etc is  equiva-
        lent  to  -C /etc.  This is typically used with recursive invoca-
        tions of make.

From the description, I think my way to simulate this option (in my question 2) is OK.

> Does the software require you use gnumake?

Not actually. The project I use has a Makefile.common for linux as well as one for SunOS. However the Makefile which is shared by both contains "make -C". Thus I think probably it's because linux has -C support for make, which may come from GNU make.

[fx:later] When I try to use gmake, I got this problem:

>>> $ gmake clean
>>> gmake[1]: *** /xxx/yyy/currentdir: Is a directory. Stop.

The program does not seem to run at all. "/xxx/yyy/currentdir" is the current directory, and is defined in Makefile.common:

  "BASE = /xxx/yyy/currentdir"

The only use of $(BASE) is

  "BASE_DIR = $\(BASE\)/zzz"

I could not figure out why this makes gmake stop.

There are different versions of make. The version under SunOS is probably called sun make. The most popular one is gmake, GNU make. The version under BSD is still different.