# monsterwm won't compile (something with cflags)



## kalle97 (Jul 30, 2012)

When I run "make" I get this error:

```
make: don't know how to make cflags. Stop
```

I've only edited the Makefile's PREFIX to "/usr" instead of "/usr/local" so all relevant files should be here:

https://github.com/c00kiemon5ter/monsterwm

Thanks.


----------



## kalle97 (Jul 30, 2012)

Solved.


----------



## SirDice (Jul 30, 2012)

I'm guessing you used gmake(1) instead of make(1)?


----------



## kalle97 (Jul 30, 2012)

Yes, I didn't know that FreeBSD had a different "make" than GNU/Linux.


----------



## GreekGoddess87 (Apr 27, 2013)

It actually doesn't work on me. I edited that too, but still the same errors. Isn't it true that source code for GNU/Linux won't compile on *BSD?


----------



## kpa (Apr 27, 2013)

It usually does assuming tools like devel/autoconf etc are used properly and the source code is of such nature that it doesn't make assumptions about the system. Source code that depends on the internals of the operating system is very rarely portable to other systems though.


----------



## jozze (Apr 29, 2013)

Try compiling with default settings, and see if it works. Then try adding more and more of your own settings to get to the root of the problem. Also, make sure your ports tree is up to date.

Usually, you shouldn't play with CFLAGS too much, since they're pretty well configured for each port. Any changes you make there will work for some packages but not for all in general, so you'd have to switch back and in some cases and recompile them again along with all dependencies, which makes it annoying in time.

There is also actually a pretty good reason, why you should keep stuff in /usr/local/ ... the thing is that /usr/ holds some parts of the base system. When you're upgrading your FreeBSD "world" and issue `# make installworld`, it may do some funny things to your installed packages there, but keeping things separate ensures your packages and their config files (yup ... /usr/local/etc/) remain intact throughout the whole procedure. Which is awesome (obviously!)


----------



## scottro (Nov 8, 2014)

I realize this is over a year old, but for people who search for monsterwm FreeBSD this seems to be the first hit, so I'll add my own details.  

In the Makefile, I changed paths to go to /usr/local/.  The Makefile had the man directory in /usr/local/share/man, I changed that to /usr/local/man. (Are we supposed to put file tags on Linux files? )

I then changed 

```
X11INC = -I/usr/X11R6/include
X11LIB = -L/usr/X11R6/lib -lX11
INCS = -I. -I/usr/include ${X11INC}
LIBS = -L/usr/lib -lc ${X11LIB}
```
to reference /usr/local
so that it read


```
X11INC = -I/usr/local/include
X11LIB = -L/usr/local/lib -lX11
INCS = -I. -I/usr/local/include ${X11INC}
LIBS = -L/usr/local/lib -lc ${X11LIB}
```

I then ran `gmake` and `gmake install` and all was good.  

The advantage it has, at least for me, over x11-wm/dwm is that it has the moveresize commands built in.  On FreeBSD, I haven't yet been able to get the moveresize patch to work. I'm not a coder, so while I suspect it's an easy fix, it's beyond my limited abilities.


----------

