diff options
Diffstat (limited to 'src/makefile.cyg')
-rw-r--r-- | src/makefile.cyg | 433 |
1 files changed, 433 insertions, 0 deletions
diff --git a/src/makefile.cyg b/src/makefile.cyg new file mode 100644 index 00000000..5481e9ae --- /dev/null +++ b/src/makefile.cyg @@ -0,0 +1,433 @@ +# This is a makefile for the Cygwin tools which may +# be downloaded by following the links from the URL: +# http://sources.redhat.com/cygwin/ +# +# To compile with this makefile, rename it from 'makefile.cyg' +# to 'makefile', then enter the src directory and type +# 'make install'. + +## +## Before you type "make depend; make", please follow these three steps. +## +## 1. Lua-support and GNU Make ifdef's +## +## The ifdef ... endif struct may not be supported by 'make' +## you are using. GNU make does and Berkeley make doesn't, for example. +## If it doesn't, you can still manually enable/disable them with minimum +## amount of effort: +## (1) Search for lines containing ifdef and endif (one occurence for each) +## (2) Comment these lines out +## (3-optional) Comment out lines surrounded by these if you are +## *not* going to compile the game with Lua scripting enabled. +## + +# Comment out this line if you don't want Lua scripting +LUA=TRUE + +#IRCARGS = -DIRC_SERVER=\"irc.worldirc.org\" -DIRC_PORT=\"6667\" -DIRC_CHANNEL=\"\#tome\" + + + +## +## 2. Installation locations and such +## +## LIBDIR, BINDIR and OWNER should be set appropriately for +## multiuser installations. +## +## If you want to keep it private or don't have root privilege +## required by "make install", set LIBDIR to ./lib/ or an absolute +## path pointing to your lib directory, and don't run "make install". +## +## NOTE: If LIBDIR is set to ./lib/ , you have to cd to parent directory +## of lib before you start the game. +## + +# Where lib/ files goes +#LIBDIR = /usr/lib/games/pernband/ +# Sysadmins of commercial Unix and/or BSD might prefer this +#LIBDIR = /usr/local/lib/pernband/ +# If you like the old default, use this one +LIBDIR = ./lib/ +# Another example: single user installation using absolute path +#LIBDIR = /home/myloginname/lib/pern/ + + +# Where PernAngband binary goes +#BINDIR = /usr/local/games +# Another common location +#BINDIR = /usr/local/bin + +# The game will run suid to this user +#OWNER = games + +## +## 3. Some "system" definitions +## +## No changes are needed to compile a version that will run on both +## X11 and Curses, in debugging mode, with maximal warnings, on many +## normal Unix machines of the Sun OS variety (non-solaris). +## +## To use an "alternative" definition, simply "modify" (or "replace") +## the definition below with one that you like. For example, you can +## change the compiler to "cc", or remove the "debugging" options, or +## remove the X11 or Curses support, etc, as desired. +## +## See also "config.h" and "h-config.h" for important information. +## +## Some "examples" are given below, they can be used by simply +## removing the FIRST column of "#" signs from the "block" of lines +## you wish to use, and commenting out "standard" block below. +## +## This is not intended to be a "good" Makefile, just a "simple" one. +## + + +# +# This is my compiler of choice, it seems to work most everywhere +# +CC = gcc + +# +# resource complier +# + +WRES = windres + +# +# Standard version (see main-x11.c and main-gcu.c) +# +# This version supports both "X11" and "curses" in a single executable. +# +# You may have to add various X11 include/library directories to the +# "INCLUDES", if your machine places files in a weird location +# (e.g. -I/usr/X11R6/include, as is almost always the case with +# linux and *BSD). Since we have seen many linux users -- arguably +# the largest unix population -- confused by this, and adding this +# usually doesn't hurt, the default rule has been changed to search +# for /usr/X11R6/include. +# +# You may be able to remove "-ltermcap" on some machines (ex: Solaris). +# +# You may have to replace "-lcurses" with "-lncurses" to use the +# "new curses" library instead of the "old curses" library, and +# you may have to add "-I/usr/include/ncurses" to the "INCLUDES", +# and/or "-DUSE_NCURSES" to "DEFINES". +# +# See "main-gcu.c" and "config.h" for some optional "curses" defines, +# including "USE_GETCH" and "USE_CURS_SET". Note that "config.h" will +# attempt to "guess" at many of these flags based on your system. +# +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = -I/usr/X11R6/include +#DEFINES = -DUSE_X11 -DUSE_GCU +#LIBS = -lX11 -lcurses -L/usr/X11R6/lib + + +## +## For cygwin +## +COPTS = -s -Wall -mno-cygwin -O2 -fno-strength-reduce +INCLUDES = +DEFINES = -DWINDOWS -DUSE_TRANSPARENCY -DUSE_EGO_GRAPHICS -DSUPPORT_GAMMA \ + -DUSE_PRECISE_CMOVIE \ + -DUSE_WINSOCK \ + $(IRCARGS) + +LIBS = -mno-cygwin -mwindows -e _mainCRTStartup -lwinmm -lwsock32 + + +## +## Variation -- Only support "main-gtk.c" (not "main-gcu.c, main-x11.c") +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = `gtk-config --cflags` +#DEFINES = -DUSE_GTK -DUSE_TRANSPARENCY +#LIBS = -lX11 -L/usr/X11R6/lib `gtk-config --libs` + +## +## Variation -- Only support "main-x11.c" (not "main-gcu.c") +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_X11 +#LIBS = -lX11 -L/usr/X11R6/lib + + +## +## Variation -- Only support "main-gcu.c" (not "main-x11.c") +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_GCU +#LIBS = -lcurses -ltermcap + + +## +## Variation -- Use "main-xaw.c" instead of "main-x11.c" +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_XAW -DUSE_GCU +#LIBS = -lXaw -lXmu -lXt -lX11 -lcurses -ltermcap -L/usr/X11R6/lib + + +## +## Variation -- Use "main-cap.c" instead of "main-gcu.c" +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_X11 -DUSE_CAP +#LIBS = -lX11 -ltermcap + + +## +## Variation -- Only work on simple vt100 terminals +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_CAP -DUSE_HARDCODE + + +## +## Variation -- this might work for Linux 1.1.93 using ncurses-1.8.7. +## +#COPTS = -Wall -O2 -fomit-frame-pointer -m486 +#INCLUDES = -I/usr/X11R6/include -I/usr/include/ncurses +#DEFINES = -DUSE_X11 -DUSE_GCU +#LIBS = -L/usr/X11R6/lib -lX11 -lncurses + + +## +## Variation -- this might work better than the suggestion above +## +#COPTS = -Wall -O2 -fomit-frame-pointer +#INCLUDES = -I/usr/X11R6/include -I/usr/include/ncurses +#DEFINES = -DUSE_X11 -DUSE_GCU -DUSE_TPOSIX -DUSE_CURS_SET +#LIBS = -lX11 -lncurses +#LDFLAGS = -s + + +## +## Variation -- compile for FreeBSD with ncurses +## -- BSD curses gives you B&W display. +## +#COPTS = -Wall -O2 -fomit-frame-pointer -m486 +#INCLUDES = -I/usr/X11R6/include +#DEFINES = -DUSE_X11 -DUSE_GCU -DUSE_NCURSES +#LIBS = -L/usr/X11R6/lib -lX11 -lncurses + + +## +## Variation -- compile for Solaris +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_X11 -DUSE_GCU -DSOLARIS +#LIBS = -lX11 -lsocket -lcurses + + +## +## Variation -- compile for SGI Indigo runnig Irix +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_X11 -DUSE_GCU -DSGI +#LIBS = -lX11 -lcurses -ltermcap -lsun + + + +## +## Variation -- compile for Dec ALPHA OSF/1 v2.0 +## +#CC = cc +##COPTS = -std -O -g3 -Olimit 4000 +#COPTS = -std -g +#INCLUDES = +#DEFINES = -DUSE_X11 -DUSE_GCU +#LIBS = -lX11 -lcurses -ltermcap -lrpcsvc + + +## +## Variation -- compile for Interactive Unix (ISC) systems +## +#COPTS = -Wall -O1 -pipe -g +#INCLUDES = +#DEFINES = -DUSE_X11 -DUSE_GCU -DISC +#LIBS = -lX11 -lcurses -lnsl_s -linet -lcposix + + +## +## Variation -- Support fat binaries under NEXTSTEP +## +#COPTS = -Wall -O1 -pipe -g -arch m68k -arch i386 +#INCLUDES = +#DEFINES = -DUSE_GCU +#LIBS = -lcurses -ltermcap + + +### End of configurable section ### + +# +# The "source" and "object" files. +# + +BASESRCS = \ + z-util.c z-virt.c z-form.c z-rand.c z-term.c z-sock.c \ + variable.c tables.c util.c cave.c cmovie.c \ + object1.c object2.c traps.c monster1.c monster2.c monster3.c \ + xtra1.c xtra2.c spells1.c spells2.c \ + melee1.c melee2.c loadsave.c files.c \ + cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \ + store.c birth.c notes.c help.c \ + status.c randart.c gods.c modules.c \ + wizard1.c wizard2.c levels.c ghost.c \ + generate.c gen_maze.c gen_evol.c dungeon.c init1.c init2.c \ + bldg.c squeltch.c wild.c powers.c plots.c \ + irc.c skills.c \ + readdib.c angband.rc main-win.c main.c + +BASEOBJS = \ + z-term.o z-rand.o z-form.o z-virt.o z-util.o z-sock.o \ + main.o main-win.o readdib.o angband.res \ + generate.o gen_maze.o gen_evol.o dungeon.o init1.o init2.o plots.o help.o \ + store.o birth.o wizard1.o wizard2.o bldg.o cmovie.o \ + cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o cmd7.o \ + loadsave.o files.o levels.o notes.o squeltch.o \ + status.o randart.o irc.o skills.o gods.o modules.o \ + xtra1.o xtra2.o spells1.o spells2.o melee1.o melee2.o \ + object1.o object2.o traps.o monster1.o monster2.o monster3.o \ + variable.o tables.o util.o cave.o ghost.o wild.o powers.o + +LUASRCS = \ + script.c lua_bind.c \ + w_util.c w_player.c w_z_pack.c w_obj.c w_mnster.c w_spells.c w_quest.c w_play_c.c w_dun.c + +TOLUASRCS = \ + lua/lapi.c lua/lcode.c lua/ldebug.c lua/ldo.c lua/lfunc.c lua/lgc.c \ + lua/llex.c lua/lmem.c lua/lobject.c lua/lparser.c lua/lstate.c lua/lstring.c \ + lua/ltable.c lua/ltests.c lua/ltm.c lua/lundump.c lua/lvm.c lua/lzio.c \ + lua/lauxlib.c lua/lbaselib.c lua/ldblib.c lua/liolib.c lua/lstrlib.c \ + lua/tolua_lb.c lua/tolua_rg.c lua/tolua_tt.c lua/tolua_tm.c lua/tolua_gp.c \ + lua/tolua_eh.c lua/tolua_bd.c + +LUAOBJS = \ + script.o lua_bind.o \ + w_util.o w_player.o w_z_pack.o w_obj.o w_mnster.o w_spells.o w_quest.o w_play_c.o w_dun.o + +TOLUAOBJS = \ + lua/lapi.o lua/lcode.o lua/ldebug.o lua/ldo.o lua/lfunc.o lua/lgc.o \ + lua/llex.o lua/lmem.o lua/lobject.o lua/lparser.o lua/lstate.o lua/lstring.o \ + lua/ltable.o lua/ltests.o lua/ltm.o lua/lundump.o lua/lvm.o lua/lzio.o \ + lua/lauxlib.o lua/lbaselib.o lua/ldblib.o lua/liolib.o lua/lstrlib.o \ + lua/tolua_lb.o lua/tolua_rg.o lua/tolua_tt.o lua/tolua_tm.o lua/tolua_gp.o \ + lua/tolua_eh.o lua/tolua_bd.o + +# +# Base sources and objects +# + +SRCS = $(BASESRCS) +OBJS = $(BASEOBJS) + + +# +# Compiler options +# + +CFLAGS = $(COPTS) $(INCLUDES) $(DEFINES) -DDEFAULT_PATH=\"$(LIBDIR)\" + + +# +# Lua support +# + +LUAFLAGS = -DUSE_LUA -Ilua -I. + +ifdef LUA +SRCS += $(LUASRCS) +OBJS += $(LUAOBJS) +SRCS += $(TOLUASRCS) +OBJS += $(TOLUAOBJS) +CFLAGS += $(LUAFLAGS) +endif + + +# +# Build the binary. The new base target. +# + +TARGET = tome +TOLUA = ./tolua + +default: $(TARGET) $(TOLUA) + +$(TARGET): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + +$(TOLUA): $(TOLUAOBJS) lua/tolua.c lua/tolualua.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TOLUAOBJS) lua/tolua.c lua/tolualua.c $(LIBS) + +# +# An install rule. +# +install: default + cp -f $(TARGET) .. + + +# +# Clean up old junk +# + +clean: + rm -f *.bak $(OBJS) + + +# +# Generate dependancies automatically +# + +depend: + makedepend $(INCLUDES) $(DEFINES) -D__MAKEDEPEND__ $(SRCS) + +.c.o: + $(CC) $(CFLAGS) -c -o $*.o $*.c + +.SUFFIXES: .rc .res +.rc.res: + $(WRES) $< -O coff -o $@ + +# +# Lua library compilation rules +# + +ifdef LUA +w_mnster.c: monster.pkg $(TOLUA) + $(TOLUA) -n monster -o w_mnster.c monster.pkg + +w_player.c: player.pkg $(TOLUA) + $(TOLUA) -n player -o w_player.c player.pkg + +w_play_c.c: player_c.pkg $(TOLUA) + $(TOLUA) -n player_c -o w_play_c.c player_c.pkg + +w_z_pack.c: z_pack.pkg $(TOLUA) + $(TOLUA) -n z_pack -o w_z_pack.c z_pack.pkg + +w_obj.c: object.pkg $(TOLUA) + $(TOLUA) -n object -o w_obj.c object.pkg + +w_util.c: util.pkg $(TOLUA) + $(TOLUA) -n util -o w_util.c util.pkg + +w_spells.c: spells.pkg $(TOLUA) + $(TOLUA) -n spells -o w_spells.c spells.pkg + +w_quest.c: quest.pkg $(TOLUA) + $(TOLUA) -n quest -o w_quest.c quest.pkg + +w_dun.c: dungeon.pkg $(TOLUA) + $(TOLUA) -n dungeon -o w_dun.c dungeon.pkg + +endif + +# DO NOT DELETE THIS LINE - make depend depends on it. |