X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=7ae2c5285317616c60af6617f31908f4f0ce45a0;hp=d5a72b66f5a5a829c98ca7270687e26a1a906c06;hb=a7fcdfd6bff8baa6278306dd9e4fa72d053bb8c9;hpb=2643f1552fca823a2922c124b49f1fa04aa5d970 diff --git a/src/Makefile b/src/Makefile index d5a72b66..7ae2c528 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,15 +21,16 @@ ### Executable name. Do not change EXE = stockfish +### Installation dir definitions +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin + ### ========================================================================== ### Compiler speed switches for both GCC and ICC. These settings are generally ### fast on a broad range of systems, but may be changed experimentally -### -### NOTE: Some versions of gcc miscompile value.h with -O2 or -O3, this is the -### safe setup, try changing to -O3 or -O2 and verify it works for you. ### ========================================================================== -GCCFLAGS = -O1 -msse +GCCFLAGS = -O3 -msse ICCFLAGS = -fast -msse ICCFLAGS-OSX = -fast -mdynamic-no-pic @@ -83,6 +84,7 @@ help: @echo "Makefile options:" @echo "" @echo "make > Default: Compiler = g++" + @echo "make gcc-popcnt > Compiler = g++ + popcnt-support" @echo "make icc > Compiler = icpc" @echo "make icc-profile > Compiler = icpc + automatic pgo-build" @echo "make icc-profile-popcnt > Compiler = icpc + automatic pgo-build + popcnt-support" @@ -94,14 +96,18 @@ help: @echo "make osx-icc64 > x86-Mac OS X 64 bit. Compiler = icpc" @echo "make osx-icc32-profile > OSX 32 bit. Compiler = icpc + automatic pgo-build" @echo "make osx-icc64-profile > OSX 64 bit. Compiler = icpc + automatic pgo-build" + @echo "make hpux > HP-UX. Compiler = aCC" @echo "make strip > Strip executable" @echo "make clean > Clean up" @echo "" all: $(EXE) .depend +test check: default + @$(PGOBENCH) + clean: - $(RM) *.o .depend *~ $(EXE) + $(RM) *.o .depend *~ $(EXE) core bench.txt ### Possible targets. You may add your own ones here @@ -111,6 +117,13 @@ gcc: CXXFLAGS="$(GCCFLAGS)" \ all +gcc-popcnt: + $(MAKE) \ + CXX='g++' \ + CXXFLAGS="$(GCCFLAGS) -DUSE_POPCNT" \ + all + + icc: $(MAKE) \ CXX='icpc' \ @@ -184,6 +197,7 @@ osx-ppc32: CXX='g++' \ CXXFLAGS="$(GCCFLAGS)" \ CXXFLAGS+='-arch ppc' \ + CXXFLAGS+='-DBIGENDIAN' \ LDFLAGS+='-arch ppc' \ all @@ -192,6 +206,7 @@ osx-ppc64: CXX='g++' \ CXXFLAGS="$(GCCFLAGS)" \ CXXFLAGS+='-arch ppc64' \ + CXXFLAGS+='-DBIGENDIAN' \ LDFLAGS+='-arch ppc64' \ all @@ -199,16 +214,16 @@ osx-x86: $(MAKE) \ CXX='g++' \ CXXFLAGS="$(GCCFLAGS)" \ - CXXFLAGS+='-arch i386' \ - LDFLAGS+='-arch i386' \ + CXXFLAGS+='-arch i386 -mdynamic-no-pic' \ + LDFLAGS+='-arch i386 -mdynamic-no-pic' \ all osx-x86_64: $(MAKE) \ CXX='g++' \ CXXFLAGS="$(GCCFLAGS)" \ - CXXFLAGS+='-arch x86_64' \ - LDFLAGS+='-arch x86_64' \ + CXXFLAGS+='-arch x86_64 -mdynamic-no-pic' \ + LDFLAGS+='-arch x86_64 -mdynamic-no-pic' \ all osx-icc32: @@ -291,6 +306,12 @@ osx-icc64-profile: $(MAKE) osx-icc64-profile-use @rm -rf profdir bench.txt +hpux: + $(MAKE) \ + CXX='/opt/aCC/bin/aCC -AA +hpxstd98 -DBIGENDIAN -mt +O3 -DNDEBUG' \ + CXXFLAGS="" \ + LDFLAGS="" \ + all strip: @@ -301,9 +322,14 @@ strip: $(EXE): $(OBJS) $(CXX) $(LDFLAGS) -o $@ $(OBJS) +### Installation +install: default + -mkdir -p -m 755 $(BINDIR) + -cp $(EXE) $(BINDIR) + -strip $(BINDIR)/$(EXE) ### Dependencies. Do not change .depend: - $(CXX) -msse -MM $(OBJS:.o=.cpp) > $@ + -@$(CXX) -msse -MM $(OBJS:.o=.cpp) > $@ 2> /dev/null -include .depend +-include .depend