2000-02-25 10:15:17 +00:00
|
|
|
# -*- makefile -*-
|
2011-02-18 21:47:20 +00:00
|
|
|
# $Id$
|
|
|
|
# Include file for GNU C++ build
|
2000-02-25 10:15:17 +00:00
|
|
|
|
2005-10-27 18:41:49 +00:00
|
|
|
ifndef PLATFORM
|
|
|
|
|
2004-01-20 15:00:03 +00:00
|
|
|
ifeq ($(TERM),cygwin)
|
|
|
|
MINGW=true
|
2005-10-27 18:41:49 +00:00
|
|
|
PLATFORM=cyg
|
2003-12-22 08:02:19 +00:00
|
|
|
else
|
|
|
|
ifeq ($(OSTYPE),msys)
|
2004-01-20 15:00:03 +00:00
|
|
|
MINGW=true
|
2005-10-27 18:41:49 +00:00
|
|
|
PLATFORM=cyg
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring EMX, $(PATH)), EMX)
|
|
|
|
PLATFORM=emx
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(DJGPP),) # DJGPP build (enviroment variable 'DJGPP' is defined)
|
|
|
|
PLATFORM=djg
|
2003-12-22 08:02:19 +00:00
|
|
|
endif
|
2005-10-27 18:41:49 +00:00
|
|
|
|
|
|
|
ifeq ($(OSTYPE),beos) # BeOS build
|
|
|
|
PLATFORM=be
|
2003-12-22 08:02:19 +00:00
|
|
|
endif
|
|
|
|
|
2006-01-18 20:49:36 +00:00
|
|
|
ifeq ($(findstring solaris, $(OSTYPE)), solaris)
|
|
|
|
PLATFORM=sun
|
|
|
|
endif
|
|
|
|
|
2009-12-16 13:18:20 +00:00
|
|
|
ifeq ($(findstring darwin, $(OSTYPE)), darwin)
|
|
|
|
PLATFORM=osx
|
|
|
|
endif
|
|
|
|
|
2005-10-27 18:41:49 +00:00
|
|
|
endif # ifndef PLATFORM
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),cyg)
|
2005-04-26 09:49:22 +00:00
|
|
|
CAT=cat
|
2006-01-18 20:49:36 +00:00
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
2005-04-26 09:49:22 +00:00
|
|
|
CC=gcc -mno-cygwin
|
|
|
|
CXX=g++ -mno-cygwin
|
|
|
|
AR=ar
|
|
|
|
RANLIB=ranlib
|
|
|
|
WINDRES=windres
|
|
|
|
EXEEXT=.exe
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2011-03-01 17:10:09 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2005-04-26 09:49:22 +00:00
|
|
|
else
|
2005-10-27 18:41:49 +00:00
|
|
|
ifeq ($(PLATFORM),emx)
|
2002-06-10 06:24:11 +00:00
|
|
|
CAT=cat
|
2006-01-18 20:49:36 +00:00
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
2000-02-25 10:15:17 +00:00
|
|
|
CC=gcc
|
|
|
|
AR=ar
|
2001-05-25 03:43:20 +00:00
|
|
|
RANLIB=ar s
|
2000-02-25 10:15:17 +00:00
|
|
|
SHELL=bash
|
|
|
|
EXEEXT=.exe
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2001-02-24 18:37:28 +00:00
|
|
|
#CC=gcc -Zomf
|
2000-02-25 10:15:17 +00:00
|
|
|
#AR=emxomfar
|
2001-05-25 03:43:20 +00:00
|
|
|
#RANLIB=emxomfar s
|
2000-02-25 10:15:17 +00:00
|
|
|
#PLATFORM=emx
|
|
|
|
#SHELL=bash
|
|
|
|
#EXEEXT=.exe
|
|
|
|
#OBJEXT=.obj
|
|
|
|
#LIBEXT=.lib
|
|
|
|
CXX=$(CC)
|
2011-03-01 17:10:09 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2000-02-25 10:15:17 +00:00
|
|
|
else
|
2005-10-27 18:41:49 +00:00
|
|
|
ifeq ($(PLATFORM),djg)
|
2002-09-29 16:06:10 +00:00
|
|
|
CAT=command.com /c type
|
2006-01-18 20:49:36 +00:00
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
2000-02-25 10:15:17 +00:00
|
|
|
CC=gcc
|
2005-05-11 05:24:41 +00:00
|
|
|
CXX=gxx
|
2000-02-25 10:15:17 +00:00
|
|
|
AR=ar
|
2001-05-20 19:19:52 +00:00
|
|
|
RANLIB=ranlib
|
2005-10-27 18:41:49 +00:00
|
|
|
SHELL=sh
|
2000-02-25 10:15:17 +00:00
|
|
|
EXEEXT=.exe
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2011-04-09 08:10:21 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2000-02-25 10:15:17 +00:00
|
|
|
else
|
2005-10-27 18:41:49 +00:00
|
|
|
ifeq ($(PLATFORM),be)
|
2003-03-29 21:33:14 +00:00
|
|
|
CAT=cat
|
2006-01-18 20:49:36 +00:00
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
2003-03-29 21:33:14 +00:00
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
|
|
|
AR=ar
|
|
|
|
RANLIB=ranlib
|
|
|
|
EXEEXT=
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2003-12-21 16:43:37 +00:00
|
|
|
LNKFLAGS+=-lbe -ltextencoding
|
2011-03-01 17:10:09 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2006-01-18 20:49:36 +00:00
|
|
|
else
|
|
|
|
ifeq ($(PLATFORM),sun) # SUN Solaris
|
|
|
|
CAT=cat
|
|
|
|
SED=gsed
|
|
|
|
GREP=ggrep
|
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
|
|
|
AR=ar
|
|
|
|
RANLIB=ranlib
|
|
|
|
EXEEXT=
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2006-02-01 10:06:07 +00:00
|
|
|
CFLAGS+=-D__SUNOS__ -D__UNIX__ -DUNIX
|
2011-03-01 17:10:09 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2011-02-18 22:16:25 +00:00
|
|
|
ifeq ($(WIDE_NCURSES),1)
|
|
|
|
LIBCURSES=-L/opt/csw/lib -lncursesw
|
|
|
|
else
|
|
|
|
LIBCURSES=-L/opt/csw/lib -lncurses
|
|
|
|
endif
|
2009-12-16 13:18:20 +00:00
|
|
|
else
|
|
|
|
ifeq ($(PLATFORM),osx) # Mac OSX
|
|
|
|
CAT=cat
|
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
|
|
|
AR=ar
|
|
|
|
RANLIB=ranlib
|
|
|
|
PLATFORM=osx
|
|
|
|
EXEEXT=
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2011-02-18 22:16:25 +00:00
|
|
|
ifeq ($(WIDE_NCURSES),1)
|
|
|
|
LIBCURSES=-lncursesw
|
|
|
|
else
|
|
|
|
LIBCURSES=-lncurses
|
|
|
|
endif
|
2011-03-01 17:10:09 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2005-10-27 18:41:49 +00:00
|
|
|
else # Linux, *BSD or another unix-like OS
|
2002-06-10 06:24:11 +00:00
|
|
|
CAT=cat
|
2006-01-27 13:17:00 +00:00
|
|
|
SED=sed
|
|
|
|
GREP=grep
|
2000-03-11 14:41:58 +00:00
|
|
|
CC=gcc
|
2000-02-25 10:15:17 +00:00
|
|
|
CXX=g++
|
|
|
|
AR=ar
|
2001-05-20 19:19:52 +00:00
|
|
|
RANLIB=ranlib
|
2000-02-25 10:15:17 +00:00
|
|
|
PLATFORM=lnx
|
|
|
|
EXEEXT=
|
|
|
|
OBJEXT=.o
|
|
|
|
LIBEXT=.a
|
2011-03-02 13:36:21 +00:00
|
|
|
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
|
2011-02-18 22:16:25 +00:00
|
|
|
ifeq ($(WIDE_NCURSES),1)
|
2009-04-19 20:48:23 +00:00
|
|
|
CFLAGS+=-I/usr/include/ncursesw/
|
2011-02-18 22:16:25 +00:00
|
|
|
LIBCURSES=-lncursesw
|
|
|
|
else
|
|
|
|
LIBCURSES=-lncurses
|
|
|
|
endif
|
2000-02-25 10:15:17 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2003-03-29 21:33:14 +00:00
|
|
|
endif
|
2006-01-18 20:49:36 +00:00
|
|
|
endif
|
2009-12-16 13:18:20 +00:00
|
|
|
endif
|
2012-05-15 22:27:35 +00:00
|
|
|
CFLAGS+=-funsigned-char -g $(INCS) -Wall -Wno-long-long -Wno-sign-compare -pedantic -O2 -DPRAGMA_PACK # -fomit-frame-pointer
|
2000-03-22 16:55:00 +00:00
|
|
|
LNKFLAGS+=-g
|
2011-06-01 20:58:44 +00:00
|
|
|
CPPFLAGS+=$(CFLAGS) -fno-pic -fno-rtti # -fno-exceptions
|
2000-02-25 10:15:17 +00:00
|
|
|
|
2011-02-18 21:47:20 +00:00
|
|
|
# Run `make USE_NCURSES=0` if you dislike ncurses
|
|
|
|
# Run `make BUGGY_NCURSES=1` if your build requires additional keypresses to
|
2003-04-28 14:41:11 +00:00
|
|
|
# pass areascan
|
2001-03-16 06:22:01 +00:00
|
|
|
# NOTE: lnx is active for any *NIX system and only ncurses mode is portable
|
2011-02-18 21:47:20 +00:00
|
|
|
USE_NCURSES?=1
|
|
|
|
BUGGY_NCURSES?=0
|
|
|
|
|
2001-03-16 06:22:01 +00:00
|
|
|
ifeq ($(PLATFORM),lnx)
|
2011-02-18 21:47:20 +00:00
|
|
|
ifeq ($(USE_NCURSES),1)
|
|
|
|
CPPFLAGS+=-D__USE_NCURSES__
|
|
|
|
ifeq ($(BUGGY_NCURSES),1)
|
|
|
|
CPPFLAGS+=-DBUGGY_NCURSES
|
|
|
|
endif
|
|
|
|
endif
|
2001-03-16 06:22:01 +00:00
|
|
|
endif
|
2000-02-25 10:15:17 +00:00
|
|
|
|
2006-01-27 13:04:36 +00:00
|
|
|
ifeq ($(PLATFORM),sun)
|
2011-02-18 21:47:20 +00:00
|
|
|
ifeq ($(USE_NCURSES),1)
|
2006-01-27 13:04:36 +00:00
|
|
|
CPPFLAGS+=-D__USE_NCURSES__
|
2011-02-18 21:47:20 +00:00
|
|
|
endif
|
2006-01-27 13:04:36 +00:00
|
|
|
endif
|
|
|
|
|
2009-12-16 13:18:20 +00:00
|
|
|
ifeq ($(PLATFORM),osx)
|
2011-02-18 21:47:20 +00:00
|
|
|
ifeq ($(USE_NCURSES),1)
|
2009-12-16 13:18:20 +00:00
|
|
|
CPPFLAGS+=-D__USE_NCURSES__
|
2011-02-18 21:47:20 +00:00
|
|
|
endif
|
2009-12-16 13:18:20 +00:00
|
|
|
endif
|
|
|
|
|
2003-04-28 14:41:11 +00:00
|
|
|
# uncomment the next line for better koi-8 support. do not do it for
|
|
|
|
# international builds since latin-1 support will be broken.
|
|
|
|
ifeq ($(PLATFORM),lnx)
|
2011-02-18 21:47:20 +00:00
|
|
|
ifeq ($(KOI8),1)
|
|
|
|
CPPFLAGS+=-DKOI8
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq "$(ICONV)" "1"
|
|
|
|
CFLAGS+=-DHAS_ICONV
|
2003-04-28 14:41:11 +00:00
|
|
|
endif
|
|
|
|
|
2003-12-21 16:43:37 +00:00
|
|
|
#uncomment the following line if you build version to be used
|
|
|
|
#on BONE-powered systems(Dan0 etc.) This improves some operations ...
|
2003-04-28 14:41:11 +00:00
|
|
|
ifeq ($(PLATFORM),be)
|
|
|
|
CPPFLAGS+=#-DBEOS_BONE_BUILD
|
|
|
|
endif
|
|
|
|
|
2000-10-24 05:02:25 +00:00
|
|
|
# force not to use coprocessor features in DOS, if you have one you may remove this
|
2000-12-02 07:11:51 +00:00
|
|
|
ifeq ($(PLATFORM),djg)
|
2005-10-29 09:16:58 +00:00
|
|
|
#CFLAGS+=-mcpu=i386 # GCC v2.x.x
|
|
|
|
CFLAGS+=-march=i386 #-mtune=i686 # GCC v3.x.x
|
|
|
|
STDLIBS+=-llocal
|
|
|
|
endif
|
|
|
|
|
|
|
|
# force not to use coprocessor features in DOS, if you have one you may remove this
|
|
|
|
ifeq ($(PLATFORM),djg)
|
2010-03-23 19:06:16 +00:00
|
|
|
#STDLIBS+= -lwmemu
|
2000-10-24 05:02:25 +00:00
|
|
|
endif
|
|
|
|
|
2000-02-25 10:15:17 +00:00
|
|
|
BIN=bin
|
|
|
|
OBJPATH=obj
|
|
|
|
LIBPATH=lib
|