X11 = 

CC = gcc
XTRAFLAGS = 
CFLAGS = -g -Wall -pipe $(XTRAFLAGS) -DUSE_X11 -DUSE_XAW -DUSE_GCU -I$(X11)/include


LDFLAGS =
CURSES = curses
LIBS = -L$(X11)/lib -lXaw -lXmu -lXt -lX11 -l$(CURSES)


SRCS = \
  z-util.c z-virt.c z-form.c z-rand.c z-term.c \
  variable.c tables.c util.c cave.c \
  object1.c object2.c monster1.c monster2.c \
  xtra1.c xtra2.c spells1.c spells2.c \
  melee1.c melee2.c save.c files.c \
  cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \
  store.c birth.c load1.c load2.c \
  wizard1.c wizard2.c \
  generate.c dungeon.c init1.c init2.c \
  main-gcu.c main-x11.c main-xaw.c main.c

OBJS = $(SRCS:.c=.o)

HDRS = \
  h-basic.h \
  h-define.h h-type.h h-system.h h-config.h

INCS = \
  angband.h \
  config.h defines.h types.h externs.h \
  z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS)



all: angband

angband: $(OBJS)
	$(CC) -o angband $(OBJS) $(LIBS) $(LDFLAGS)

sun:
	$(MAKE) XTRAFLAGS=-DSOLARIS X11=/usr/openwin LDFLAGS=-lsocket

sgi: 
	$(MAKE) XTRAFLAGS=-DSGI

linux:
	$(MAKE) XTRAFLAGS=-DANGBAND_LITTLE_ENDIAN X11=/usr/X11R6 CURSES=ncurses

netbsd:
	$(MAKE) XTRAFLAGS=-DANGBAND_LITTLE_ENDIAN -DSPECIAL_BSD X11=/usr/X11R6 LDFLAGS=-ltermcap

clean:
	rm -f $(OBJS) angband


sources: $(SRCS) $(INCS)

depend:
	makedepend -D__MAKEDEPEND__ $(SRCS)




