# Make vs gmake, misunderstanding?



## DavidMarec (Dec 4, 2011)

hi all,

Since a couple of weeks, I get the following behavior, for each attempt to build some ports, e.g. ImageMagick, glib-2 ...


The builds fail on a make/gmake error, like the following:

```
===>  Building for glib-2.28.8_2
make  all-recursive
make: illegal option -- -
usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable]
        [-d flags] [-E variable] [-f makefile] [-I directory]
        [-j max_jobs] [-m directory] [-V variable]
        [variable=value] [target ...]
gmake: *** [all] Erreur 2
```


```
===>  Building for ImageMagick-6.7.3.4
/bin/sh ./config/mkinstalldirs . ltdl/
cp ./ltdl/argz_.h ltdl/argz.h-t
mv ltdl/argz.h-t ltdl/argz.h
make  all-am
make: illegal option -- -
usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable]
        [-d flags] [-E variable] [-f makefile] [-I directory]
        [-j max_jobs] [-m directory] [-V variable]
        [variable=value] [target ...]
gmake: *** [all] Erreur 2
*** Error code 1
```

This sounds like the 'illegal option' required by Make is a gmake knob, or the reverse ...

By the fact, if I comment out 
	
	



```
USE_GMAKE
```
 in the Makefile, the build of ImageMagick starts normally (but I get other errors later on).

Any clue is welcome.


----------



## wblock@ (Dec 4, 2011)

Check /etc/make.conf.  The shell init file could set environment variables or aliases that cause one make to be run when the other is needed.  Is it possible that gmake was copied over or renamed to make?


----------



## DavidMarec (Dec 5, 2011)

wblock@ said:
			
		

> Check /etc/make.conf.



Nothing else than the usual entries in /etc/make.conf.
i.e., CCACHE and CSUP settings.



> The shell init file could set environment variables or aliases that cause one make to be run when the other is needed.  Is it possible that gmake was copied over or renamed to make?



I don't think so, for example:

```
david:/home/david#make -v
make: no target to make.
david:/home/david#gmake -v
GNU Make 3.82
Construit pour amd64-portbld-freebsd9.0
Copyright (C) 2010  Free Software Foundation, Inc.
Licence GPLv3+ : GNU GPL version 3 ou ultÃ©rieure <http://gnu.org/licenses/gpl.html>
Ceci est un logiciel libre : vous Ãªtes autorisÃ© Ã  le modifier et Ã  la redistribuer.
Il ne comporte AUCUNE GARANTIE, dans la mesure de ce que permet la loi.
```

make and gmake are calls to differents softwares, as far as i see.

Or is there something else that must be checked, to be sure that some pieces of bsdmake or gmake doesn't override each other ?

Really, I don't understand what is responsible of this behavior, and what could be the cause.


----------



## DavidMarec (Dec 5, 2011)

DavidMarec said:
			
		

> Nothing else than the usual entries in /etc/make.conf.



My bad, i found a typo in the ~.cshrc, regarding CCACHE path.

Now, ImageMagick has been compiled sucessfully, 
- but it do not pass out the `exception` autocheck -.

It's a bit strange that this affects only gmake.

anyway, thanks for your help, wblock@.


----------



## phoenix (Dec 5, 2011)

Does it work if you remove any and all mentions of ccache?


----------



## wblock@ (Dec 5, 2011)

ccache for ports is probably not worthwhile anyway.  Ports aren't rebuilt very often, and by the time they are, the copies will have likely have been cycled out of the cache.


----------

