Makefile generated by Eclipse CDT doesn't work in FreeBSD

I created HelloWorld C++ project in Ubuntu, Eclipse CDT. CDT generates makefile which can be executed from command line: make. It works well in original Ubuntu location.
Now I move the whole project tree to FreeBSD computer and try to build makefile here. Result is:

Code:
# make
"makefile", line 5: Need an operator
"makefile", line 10: Need an operator
"makefile", line 11: Need an operator
"makefile", line 12: Need an operator

Makefile looks like this:
Code:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
...

I get error message on every -include line. Manually written makefile works in FreeBSD:

Code:
all:
	g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "main.cpp"
	g++  -o"Test"  ./main.o

Why GCC on FreeBSD doesn't understand CDT generated makefile? GCC version on Ubuntu is:
gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
GCC version on FreeBSD is:
4.2.1 20070719 [FreeBSD]
 
make your own makefile ;)
They are easy to create.
Besides as much as I have used generated makefiles, manually created makefiles, were much smaller, simper and much more portable
 
Yes, I can write my own makefile, this is not a problem for HelloWorld project :) But my actual CDT workspace in Ubuntu contains many of projects, with using third-party libraries, and I need a way to use existing makefiles as is. I want to copy the whole workspace to FreeBSD and just build it from the command line.
Maybe GCC installed on FreeBSD doesn't understand -include lines? It my GCC version is up-to-date?
 
SirDice, sorry for stupid question, but my FreeBSD experience is only two days :) I understand from your post, that I need to install the gmake package on FreeBSD, and use gmake instead of make to build Linux-generated files, is this correct?
 
AlexF said:
SirDice, sorry for stupid question, but my FreeBSD experience is only two days :) I understand from your post, that I need to install the gmake package on FreeBSD, and use gmake instead of make to build Linux-generated files, is this correct?

No,
By default you are using make which is included in FreeBSD base system.
For example
Code:
make -f Makefile

you need to install gmake (probably already installed) and use
Code:
gmake -f Makefile

for this to work you need to configure your Eclipse, somewhere related to GNU utilities...
 
Back
Top