Author Topic: Problems with makefile  (Read 5264 times)

New_Programmer

  • Guest
Problems with makefile
« on: March 31, 2009, 06:51:38 pm »
Hello!  I'm just starting to learn c++.  I also like to play chess against other people and against computer programs.  There is a very famous chess program called Fruit 2.1 that I have been trying to compile the windows version before I edit the source code to change its playing style.  You can find the source at:

http://arctrix.com/nas/chess/fruit/

I'm using code::blocks IDE and have tried the watcom, borland 5.5, and the gnu gcc compilers to compile the makefile.  gnu gcc gives me the least amount of errors, only one error to be exact.

***************
the makefile build log says:

pv.cpp random.cpp recog.cpp search.cpp search_full.cpp see.cpp sort.cpp square.cpp trans.cpp util.cpp value.cpp vector.cpp > .depend
mingw32-make.exe: *** No rule to make target `Release'.  Stop.
Process terminated with status 2 (0 minutes, 2 seconds)
1 errors, 0 warnings

***************
the makefile build messages says:

Makefile|47|.depend: No such file or directory|
||=== Build finished: 1 errors, 0 warnings ===|
***************

the makefile looks like this:

==========================================

# files

EXE = fruit

OBJS = attack.o board.o book.o eval.o fen.o hash.o list.o main.o material.o \
       move.o move_check.o move_do.o move_evasion.o move_gen.o move_legal.o \
       option.o pawn.o piece.o posix.o protocol.o pst.o pv.o random.o recog.o \
       search.o search_full.o see.o sort.o square.o trans.o util.o value.o \
       vector.o

# rules

all: $(EXE) .depend

clean:
   $(RM) *.o .depend gmon.out

# general

CXX      = g++
CXXFLAGS = -pipe
LDFLAGS  = -lm

# C++

CXXFLAGS += -fno-exceptions -fno-rtti

# optimisation

CXXFLAGS += -O3 -fstrict-aliasing
CXXFLAGS += -fomit-frame-pointer
# CXXFLAGS += -march=athlon-xp # SELECT ME

# strip

LDFLAGS += -s

# dependencies

$(EXE): $(OBJS)
   $(CXX) $(LDFLAGS) -o $@ $(OBJS)

.depend:
   $(CXX) -MM $(OBJS:.o=.cpp) > $@

include .depend
==========================================

could somebody explain to me in the greatest of layman's terms what i have to do to fix this....................................

New_Programmer

  • Guest
Re: Problems with makefile
« Reply #1 on: March 31, 2009, 06:52:41 pm »
I finally compiled the Fruit 2.1 chess engine source without the makefile using the code::blocks IDE and the GNU GCC compiler. The executable runs fine, but I have some new questions that I hope others can answer.

A: The downloaded Fruit 2.1 chess engine source comes with an executable that runs much faster than the one I created with the GNU GCC compiler. Why is the executable I created so much slower? I have not modified the source files yet and I tried checking some of the speed optimizations in the GNU GCC compiler settings. The two programs
do exactly the same thing, but the one I created is much slower.

B: The downloaded Fruit 2.1 chess engine executable displays information on the "Arena GUI" (i.e. knodes/second, total nodes evaluated) that my executable does not. Why?

C: Do all commercial IDEs come with some special tools to get the most out of certain compilers? In other words are they able to fully optimize source code to create a better performing executable while those of us who use a free IDE like code::blocks cannot. If so, that is a major bummer because then I'll have to buy me an expensive IDE that can better optimize code and better utilize certain c++ compilers.


Please remember that some of us don't know the answers to these questions because we are just learning to program.





Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problems with makefile
« Reply #2 on: March 31, 2009, 07:14:23 pm »
About the error with the makefile:
in the projects build options chose the "Make" commands tab and remove the $target-variable from the appropriate make-command(s) or rename your build target to one that exists in the makefile (in your case all, but that's also the default one).

After that changes the makefile should be usable.

To see what is really passed to the compiler, you can switch on full commandline logging:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline".


About the other questions and your final statement:

Please remember that some of us don't know the answers to these questions because we are just learning to program.

Please remember, that this is not a beginners programming forum.

This forum is dedicated to the use and developing of codeblocks, no more and no less !!!

Topic locked !