# File: Makefile.dos

#
# Makefile support for "main-dos.c" and "main-ibm.c"
#
# See "main-dos.c" and "main-ibm.c" for more information.
#


#
# 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 randart.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 

# Compiler
CC = gcc

# Compiler flags
CFLAGS = -Wall -O2 -s -DUSE_DOS -DUSE_IBM


# Libraries
LIBS = -lpc


#
# Targets
#

default: oangband.exe
	copy oangband.exe ..
	del oangband.exe

install: oangband.exe makepref.exe gredit.exe
	copy oangband.exe ..
	copy makepref.exe ..
	copy gredit.exe ..

all: angband.exe makepref.exe gredit.exe
	@echo All done.  Use 'make install' to install.


#
# Link executables
#

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

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

gredit.exe: gredit.o
	$(CC) $(CFLAGS) -o $@ gredit.o $(LIBS) -lgrx20


#
# Compile source files
#

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


#
# Clean up
#

clean:
	del *.o
	del *.bin

cleanall: clean
	del *.exe

