Hello,
Just installed the April 09 Nightly-Build and the latest release of MinGW and installed the GCC compiler and MinGW Make. I have a Linux project I'm participating in that uses a lot of makefiles. My job is to port this project to Windows, and a developer suggests that i use the makefiles to get everything to compile.
My question is, how do i go about doing such a thing in C::B?
I'm pretty lost on this one.
looked on the MinGW site and searched here, but didn't see much info about using makefiles. only stuff to help generate your own.
Search on "Custom Makefile".
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_My_project_should_be_compiled_with_a_custom_makefile._Is_it_possible_with_Code::Blocks.3F
Tim S
i've selected it and pointed to the makefile, but it didn't do anything. are you sure that's all i need to do?
No you also need a Makefile and it needs the tasks to be named as Code::Blocks wants them to be named.
Or you can make Code::Blocks match the makefile.
What are the tasks in your makefile?
all, clean are common tasks names.
Is the makefile in the same folder as the project file?
Turn on Compiler logging to get info to help debug.
Tim S
Ok, went to Settings>Compiler and Debugger>Debugger Options>Display Debugger's Log.
Also, do i run a makefile simply by doing a build and run? or do i have to do something else.
Oh yeah,
[source directory]
+[my project directory]
+[source code i'm working with]
+[folder with my Makefile]
Quote-------------- Build: Debug in JMax-Phoenix-windows ---------------
Using makefile: Makefile
mingw32-make.exe: *** No rule to make target `Debug'. Stop.
Process terminated with status 2 (0 minutes, 1 seconds)
0 errors, 0 warnings
the debugger tab shows nothing
Fix the targets; so they match.
What are the target/tasks in your makefile?
Tim S
this is open source, so i guess i can just leave the license intact and show you the makefile. The file structure is the same as SVN so everything should match.(sorry I really don't know much about makefiles even though i have used them in the past, i find them confusing.)
#
# jMax
# Copyright (C) 1994, 1995, 1998, 1999 by IRCAM-Centre Georges Pompidou, Paris, France.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# See file LICENSE for further informations on licensing terms.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Based on Max/ISPW by Miller Puckette.
#
# Authors: Maurizio De Cecco, Francois Dechelle, Enzo Maggi, Norbert Schnell.
#
include ./core/Makefiles/Makefile.config
default:
+make MODE=debug BUILDDIR="~/tmp/jmax/build" DISTDIR="~/distrib/jmax/" clean clobber tar
all: core packages docs
core:
(cd core; $(MAKE) all)
packages:
(cd packages; $(MAKE) all)
docs:
(cd docs; $(MAKE) distrib)
REV = $(shell "svnversion" | sed "s/:/./")
tar: all
(cd $(DISTDIR)/.. ; tar cvzf jmax.$(shell uname -s).$(shell uname -m).r$(REV).tgz --exclude=".svn" jmax)
clean:
/bin/rm -rf $(BUILDDIR)
clobber: clean
/bin/rm -rf $(DISTDIR)
test:
echo No test implemented yet
tags:
(find . \! \( -name '*~' \) \( -name "*.c" -o -name "*.h" -o -name "*.java" -o -name "Makefile.*" -o -name "Makefile" -o -name "*.tcl" \) -print | etags - )
tags-test:
find . \! \( -name '*~' \) \( -name "*.c" -o -name "*.h" -o -name "*.java" -o -name "Makefile.*" -o -name "Makefile" -o -name "*.tcl" \) -print
.PHONY: tags
.PHONY: tar
.PHONY: all
.PHONY: core
.PHONY: docs
.PHONY: packages
.PHONY: clean
.PHONY: clobber
The target "all" exists in makefile will use that
"Project" -> "Properties"
Tab "Build Targets"
Select the best target for building; I normally use "release"
Click on "rename" change the name to makefile target name of "all".
Note: I usually delete all the targets but the one I renamed to "all".
But, I have never used this for a medium or larger project.
Then try to build it again.
Tim S