# File: Makefile.dos

# Purpose: Makefile support for "main-dos.c"

#
# Note: Rename to "Makefile" before using
#
# Allegro support by Robert Ruehlmann (rr9@angband.org)
#

# Compiling with MOD-file support:
# - Get the JG-MOD library from http://www.jgmod.home.ml.org and install it.
# - Insert -ljgmod in front of -lalleg to the Libraries section.
# - Add -DUSE_MOD_FILES to the compiler flags.
# - Copy your MOD-files into the "lib/xtra/music" folder.


#
# Basic definitions
#

# Objects
OBJS = \
  main.o main-dos.o main-ibm.o \
  generate.o dungeon.o init1.o init2.o \
  store.o birth.o wizard1.o wizard2.o \
  cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \
  load1.o load2.o save.o files.o \
  xtra1.o xtra2.o spells1.o spells2.o melee1.o melee2.o \
  object1.o object2.o monster1.o monster2.o \
  variable.o tables.o util.o cave.o \
  z-term.o z-rand.o z-form.o z-virt.o z-util.o \
  bldg.o script.o

# Compiler
CC = gcc

# Compiler flags
CFLAGS = -Wall -O2 -s -DUSE_DOS -DUSE_IBM -DUSE_BACKGROUND \
-DUSE_TRANSPARENCY


# Libraries
LIBS = -lpc -lalleg -lslang


#
# Targets
#

default: zangband.exe
	copy zangband.exe ..
	del zangband.exe

install: zangband.exe
	copy zangband.exe ..

all: zangband.exe
	@echo All done.  Use 'make install' to install.


#
# Link executables
#

zangband.exe: $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)


#
# Compile source files
#

.c.o:
	$(CC) $(CFLAGS) -c $*.c


#
# Clean up
#

clean:
	del *.o

cleanall: clean
	del *.exe

