2000-03-29 15:32:08 -07:00
|
|
|
## ___________ _________ _____ __
|
|
|
|
## \_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
|
|
|
|
## | __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \\ __\\ __\
|
|
|
|
## | \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
|
|
|
|
## \___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
|
|
|
|
## \/ \/ \/ \/ \/
|
|
|
|
## ______________________ ______________________
|
|
|
|
## T H E W A R B E G I N S
|
|
|
|
## FreeCraft - A free fantasy real time strategy game engine
|
2001-02-19 10:04:24 -07:00
|
|
|
##
|
2001-03-09 10:50:25 -07:00
|
|
|
## Rules.make - Make RULES (GNU MAKE) (included from Makefile).
|
2000-03-29 15:32:08 -07:00
|
|
|
##
|
2002-02-14 13:17:34 -07:00
|
|
|
## (c) Copyright 1998-2002 by Lutz Sammer
|
2000-03-29 15:32:08 -07:00
|
|
|
##
|
2001-05-30 09:24:09 -06:00
|
|
|
## FreeCraft is free software; you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published
|
2002-03-27 10:44:30 -07:00
|
|
|
## by the Free Software Foundation; only version 2 of the License.
|
2001-05-30 09:24:09 -06:00
|
|
|
##
|
|
|
|
## FreeCraft 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.
|
|
|
|
##
|
2000-03-29 15:32:08 -07:00
|
|
|
## $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Configurable:
|
2001-02-19 10:04:24 -07:00
|
|
|
# Choose what you want to include and the correct
|
2000-03-29 15:32:08 -07:00
|
|
|
# version. Minimal is now the default.
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
2001-02-19 10:04:24 -07:00
|
|
|
# Uncomment next to add threaded sound support
|
2000-03-29 15:32:08 -07:00
|
|
|
# You should have a thread safe X11 (libc6 or glibc)
|
2001-03-09 10:50:25 -07:00
|
|
|
# Any modern linux distribution are thread safe.
|
2001-03-17 19:13:33 -07:00
|
|
|
# Don't enable, if you use SDL sound support.
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
#THREAD = -D_REENTRANT -DUSE_THREAD
|
|
|
|
#THREADLIB = -lpthread
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Video driver part
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# SDL - Simple DirectMedia Layer configuration (any >=1.0.0)
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
SDL_CFLAGS = $(shell sdl-config --cflags)
|
2001-03-09 10:50:25 -07:00
|
|
|
SDLLIB = $(shell sdl-config --static-libs)
|
|
|
|
#SDLLIB = $(shell sdl-config --libs)
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-02-07 17:24:03 -07:00
|
|
|
# Without SDL Sound (only not win32)
|
2000-03-29 15:32:08 -07:00
|
|
|
#SDL = -DUSE_SDL $(SDL_CFLAGS)
|
|
|
|
# With SDL Sound
|
|
|
|
SDL = -DUSE_SDL -DUSE_SDLA $(SDL_CFLAGS)
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Uncomment the next for the normal X11 support.
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
VIDEO = -DUSE_X11
|
|
|
|
VIDEOLIB = -lXext -lX11 -ldl
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Uncomment th next to get svgalib support.
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
#VIDEO = -DUSE_SVGALIB
|
|
|
|
#VIDEOLIB = -lvga -lm -ldl
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Uncomment one of the next for the SDL support.
|
|
|
|
|
|
|
|
# Uncomment the next for the generic SDL support.
|
|
|
|
|
|
|
|
#VIDEO = $(SDL)
|
|
|
|
#VIDEOLIB = $(SDLLIB)
|
|
|
|
|
|
|
|
# Uncomment the next for the SDL X11/SVGALIB support.
|
|
|
|
|
|
|
|
#VIDEO = $(SDL)
|
|
|
|
#VIDEOLIB = $(SDLLIB) -lXext -lX11 -lXxf86dga -lXxf86vm -lvga -lvgagl -ldl -lesd -lm -lslang -lgpm
|
|
|
|
|
2001-02-08 08:08:45 -07:00
|
|
|
# Uncomment the next for the win32/cygwin support. (not working?)
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
#VIDEO = -DUSE_WIN32 $(SDL)
|
|
|
|
#VIDEOLIB = $(SDLLIB)
|
|
|
|
|
|
|
|
# Uncomment the next for the win32/mingw32 support.
|
|
|
|
|
|
|
|
#VIDEO = -DUSE_WIN32 $(SDL)
|
|
|
|
#VIDEOLIB = $(SDLLIB) -lwsock32 -Wl,--stack,33554432
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
# Uncomment the next for the BeOS SDL support.
|
|
|
|
|
|
|
|
#VIDEO = -DUSE_BEOS $(SDL)
|
|
|
|
#VIDEOLIB = $(SDLLIB)
|
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Sound driver part
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
# See above the USE_SDLA option.
|
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
# Comment next if you want to remove sound support.
|
|
|
|
|
|
|
|
DSOUND = -DWITH_SOUND
|
|
|
|
|
2002-03-27 10:44:30 -07:00
|
|
|
# Uncomment the next to enable Ogg vorbis support.
|
|
|
|
OGGLIB = -lvorbisfile -lvorbis -logg
|
|
|
|
|
|
|
|
# Uncomment the next to enable Flac support.
|
|
|
|
FLACLIB = -lFLAC
|
|
|
|
|
|
|
|
# Uncomment the next to enable mp3 support (using libmad).
|
|
|
|
MP3LIB = -lmad
|
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# File I/O part
|
2000-03-29 15:32:08 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Choose which compress you like
|
2001-08-02 08:40:58 -06:00
|
|
|
# New zziplib support added
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
# None
|
|
|
|
#ZDEFS =
|
|
|
|
#ZLIBS =
|
|
|
|
# GZ compression
|
|
|
|
ZDEFS = -DUSE_ZLIB
|
|
|
|
ZLIBS = -lz
|
|
|
|
# BZ2 compression
|
|
|
|
#ZDEFS = -DUSE_BZ2LIB
|
|
|
|
#ZLIBS = -lbz2
|
|
|
|
# GZ + BZ2 compression
|
|
|
|
#ZDEFS = -DUSE_ZLIB -DUSE_BZ2LIB
|
|
|
|
#ZLIBS = -lz -lbz2
|
2001-08-02 08:40:58 -06:00
|
|
|
# GZ + BZ2 + ZZIP compression
|
|
|
|
#ZDEFS = -DUSE_ZLIB -DUSE_BZ2LIB -DUSE_ZZIPLIB
|
|
|
|
#ZLIBS = -lzzip -lz -lbz2
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# May be required on some distributions for libpng and libz!
|
|
|
|
# extra linker flags and include directory
|
2001-02-19 10:04:24 -07:00
|
|
|
# -L/usr/lib
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-08-02 08:40:58 -06:00
|
|
|
XLDFLAGS = -L/usr/X11R6/lib -L/usr/local/lib
|
|
|
|
XIFLAGS = -I/usr/X11R6/include -I/usr/local/include
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-06-15 19:24:34 -06:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Support for SIOD (scheme interpreter)
|
|
|
|
# C C L - Craft Configuration Language
|
|
|
|
|
|
|
|
CCL = -DUSE_CCL
|
|
|
|
CCLLIB = -lm
|
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
#------------------------------------------------------------------------------
|
2002-03-30 05:50:22 -07:00
|
|
|
# Where do you want it installed?
|
|
|
|
|
|
|
|
# Prefix for 'make install'
|
|
|
|
PREFIX=/usr/local
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
2001-02-19 10:04:24 -07:00
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
# Uncomment next to profile
|
|
|
|
#PROFILE= -pg
|
2001-08-02 08:40:58 -06:00
|
|
|
# Uncomment next to profile with basic blocks
|
|
|
|
#PROFILE= -pg -a
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-03-09 10:50:25 -07:00
|
|
|
# Compile Version
|
2002-04-09 16:16:51 -06:00
|
|
|
VERSION= '-DVERSION="1.17pre1-build18"'
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# below this, nothing should be changed!
|
|
|
|
|
|
|
|
# Libraries needed to build tools
|
|
|
|
TOOLLIBS=$(XLDFLAGS) -lpng -lz -lm $(THREADLIB)
|
|
|
|
|
2000-04-03 17:37:55 -06:00
|
|
|
# Libraries needed to build freecraft
|
2002-03-27 10:44:30 -07:00
|
|
|
CLONELIBS=$(XLDFLAGS) -lpng -lz -lm $(FLACLIB) $(OGGLIB) $(MP3LIB) \
|
2001-08-02 08:40:58 -06:00
|
|
|
$(THREADLIB) $(CCLLIB) $(VIDEOLIB) $(ZLIBS) #-lefence
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
DISTLIST=$(TOPDIR)/distlist
|
|
|
|
TAGS=$(TOPDIR)/src/tags
|
|
|
|
|
|
|
|
# LINUX
|
2000-04-03 17:37:55 -06:00
|
|
|
OUTFILE=$(TOPDIR)/freecraft
|
2000-03-29 15:32:08 -07:00
|
|
|
ARCH=linux
|
|
|
|
OE=o
|
|
|
|
EXE=
|
2002-04-17 12:06:56 -06:00
|
|
|
OBJDIR=.
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
# WIN32
|
2000-04-03 17:37:55 -06:00
|
|
|
#OUTFILE=$(TOPDIR)/freecraft$(EXE)
|
2000-03-29 15:32:08 -07:00
|
|
|
#ARCH=win32
|
|
|
|
#OE=o
|
|
|
|
#EXE=.exe
|
2002-04-17 12:06:56 -06:00
|
|
|
#OBJDIR=.
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
## architecture-dependant objects
|
|
|
|
#ARCHOBJS=stdmman.$(OE) svgalib.$(OE) unix_lib.$(OE) bitm_lnx.$(OE)
|
|
|
|
|
|
|
|
## include flags
|
|
|
|
IFLAGS= -I$(TOPDIR)/src/include $(XIFLAGS)
|
|
|
|
## define flags
|
2001-03-09 10:50:25 -07:00
|
|
|
#DEBUG= -DDEBUG # -DREFS_DEBUG # -DFLAG_DEBUG
|
2001-02-07 17:24:03 -07:00
|
|
|
##
|
2001-04-30 05:45:11 -06:00
|
|
|
## SLOW_INPUT If you have problems that events aren't fetched.
|
2001-10-21 07:38:10 -06:00
|
|
|
## BPP8_* Only for X11 8bpp common palette:
|
|
|
|
## BPP8_NORMAL disables default, like other Xbpp (delivers errors)
|
|
|
|
## BPP8_WINSAFE Uses a windows safe palette instead.
|
|
|
|
## BPP8_IRGB Uses a palette based on 4x4x4 RGB in 4 intensities
|
2001-02-07 17:24:03 -07:00
|
|
|
## There are some still not well tested code parts or branches.
|
2001-08-02 08:40:58 -06:00
|
|
|
## UNIT_ON_MAP: Fast lookup of units
|
|
|
|
## UNITS_ON_MAP: Faster lookup of units
|
2001-04-30 05:45:11 -06:00
|
|
|
## NEW_AI: New better improved AI code
|
2001-07-16 01:34:00 -06:00
|
|
|
## USE_TILECACHE: Faster tile drawing, costs memory.
|
|
|
|
## USE_SMART_TILECACHE: Faster tile drawing, slow with hardware video memory.
|
2001-08-02 08:40:58 -06:00
|
|
|
## USE_HP_FOR_XP Use hit-points for XP calculations.
|
2001-10-21 07:38:10 -06:00
|
|
|
## NEW_NETMENUS: Include new menu driven network set-up.
|
|
|
|
## USE_LIBMODPLUG: Use modplug audio player support.
|
2002-03-16 14:20:06 -07:00
|
|
|
## USE_SDLCD Use the SDL cd player support.
|
|
|
|
## USE_LIBCDA Use the LIBCDA cd player support.
|
2001-10-21 07:38:10 -06:00
|
|
|
## USE_FLAC: Use flac audio player support.
|
|
|
|
## USE_OGG: Use ogg audio player support.
|
|
|
|
## USE_MAD: Use mad mp3 audio player support.
|
2002-03-27 10:44:30 -07:00
|
|
|
## These aren't working yet:
|
|
|
|
## NEW_MAPDRAW: Stephans new map draw code (broken in this release)
|
|
|
|
## USE_FFMPEG Use ffmpeg video player support.
|
2001-02-07 17:24:03 -07:00
|
|
|
## NEW_FOW: New fog of war code, should work correct
|
2001-02-19 10:04:24 -07:00
|
|
|
## NEW_SHIPS: New correct ship movement.
|
2002-01-15 15:13:49 -07:00
|
|
|
## HIERARCHIC_PATHFINDER: Use hierarchic pathfinder
|
2001-10-21 07:38:10 -06:00
|
|
|
## USE_LUA: Lua scripting support
|
2001-03-09 10:50:25 -07:00
|
|
|
DFLAGS= $(THREAD) $(CCL) $(VERSION) $(VIDEO) $(ZDEFS) $(DSOUND) $(DEBUG) \
|
2002-03-27 10:44:30 -07:00
|
|
|
-DHAVE_EXPANSION -DUNIT_ON_MAP -DNEW_AI -DUSE_FLAC -DUSE_OGG -DUSE_MAD \
|
|
|
|
# -DNEW_MAPDRAW=1 -DNEW_FOW -DNEW_SHIPS -DNEW_NETMENUS
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
## choose optimise level
|
2001-02-08 08:08:45 -07:00
|
|
|
#CFLAGS=-g -O0 $(PROFILE) -pipe -Wcast-align -Wall -Werror $(IFLAGS) $(DFLAGS)
|
|
|
|
#CFLAGS=-g -O1 $(PROFILE) -pipe -Wcast-align -Wall -Werror $(IFLAGS) $(DFLAGS)
|
|
|
|
#CFLAGS=-g -O2 $(PROFILE) -pipe -Wcast-align -Wall -Werror $(IFLAGS) $(DFLAGS)
|
|
|
|
#CFLAGS=-g -O3 $(PROFILE) -pipe -Wcast-align -Wall -Werror $(IFLAGS) $(DFLAGS)
|
2001-03-09 10:50:25 -07:00
|
|
|
CFLAGS=-g -O3 $(PROFILE) -pipe -Wcast-align -Wall $(IFLAGS) $(DFLAGS)
|
2000-03-29 15:32:08 -07:00
|
|
|
#CFLAGS=-g -O6 -pipe -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS)
|
|
|
|
#-- Production
|
2001-03-09 10:50:25 -07:00
|
|
|
#CFLAGS=-O6 -pipe -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS)
|
2000-03-29 15:32:08 -07:00
|
|
|
#CFLAGS=-O6 -pipe -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS) -static
|
|
|
|
|
2002-04-05 05:50:23 -07:00
|
|
|
CC=cc -fsigned-char
|
2002-03-30 19:18:54 -07:00
|
|
|
CCLD=cc
|
2000-03-29 15:32:08 -07:00
|
|
|
RM=rm -f
|
|
|
|
MAKE=make
|
|
|
|
|
2001-08-02 08:40:58 -06:00
|
|
|
# TAGS 5.0
|
|
|
|
CTAGSFLAGS=--c-types=defmpstuvx -a -f
|
|
|
|
#CTAGSFLAGS=-i defmpstuvFS -a -f
|
2001-03-09 10:50:25 -07:00
|
|
|
#CTAGSFLAGS=-i defptvS -a -f
|
2000-03-29 15:32:08 -07:00
|
|
|
|
|
|
|
#
|
|
|
|
# Locks versions with symbolic name
|
|
|
|
#
|
|
|
|
LOCKVER= rcs -q -n$(NAME)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
2001-09-27 17:17:06 -06:00
|
|
|
@$(AR) cru $(TOPDIR)/src/libclone.a $@
|
2000-03-29 15:32:08 -07:00
|
|
|
|
2001-08-02 08:40:58 -06:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
2001-09-27 17:17:06 -06:00
|
|
|
@$(AR) cru $(TOPDIR)/src/libclone.a $@
|
2001-08-02 08:40:58 -06:00
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
#------------
|
|
|
|
# Source code documentation
|
|
|
|
#
|
|
|
|
DOXYGEN= doxygen
|
|
|
|
DOCIFY= docify
|
|
|
|
DOCPP= doc++
|
|
|
|
# Still didn't work
|
|
|
|
#DOCIFY= /root/doc++-3.4.2/src/docify
|
|
|
|
#DOCPP= /root/doc++-3.4.2/src/doc++
|
|
|
|
|
|
|
|
%.doc: %.c
|
|
|
|
@$(TOPDIR)/tools/aledoc $< | $(DOCIFY) > $*-c.doc 2>/dev/null
|
|
|
|
|
2001-08-02 08:40:58 -06:00
|
|
|
%.doc: %.cpp
|
|
|
|
@$(TOPDIR)/tools/aledoc $< | $(DOCIFY) > $*-cpp.doc 2>/dev/null
|
|
|
|
|
2000-03-29 15:32:08 -07:00
|
|
|
%.doc: %.h
|
|
|
|
@$(TOPDIR)/tools/aledoc $< | $(DOCIFY) > $*-h.doc 2>/dev/null
|