#######################################################################
#
# xjumpx default Makefile.
#
#	xjumpx mode is 2755, group is games
#	scorefile directory mode is 770, group is games.
#	so, xjumpx can access scorefile, but users cannot access it.
#
########################################################################


## X11 base directory

X11BASE = /usr/X11R6


## directory for record files
RECORD_DIR  = $(X11BASE)/lib/X11/xjumpx

## file name
## don't use /[0-9]+(\.dat|\.swap|\.lock)?/ (regular exp)
## these name are used for personal record file.

## filename of record file (it is built in binary)
RECORD_FILE  = $(RECORD_DIR)/record.dat

## filename of swap record file (it is built in binary)
SWAP_FILE  = $(RECORD_DIR)/record.swap

## filename of lock file (it is built in binary)
LOCK_FILE  = $(RECORD_DIR)/record.lock

## number of record entry (it is built in binary)
RECORD_ENTRY  = 10
RECORD_ENTRY_PRIVATE  = 10

## install target name
TARGET = $(X11BASE)/bin/xjumpx

## manual directory
MANDIR = $(X11BASE)/man/man1

# app-defaults
APP_DEFAULTS = $(X11BASE)/lib/X11/app-defaults

########################################################

## C compiler
CC      = gcc

## additional include file directory
IDIR    = -I$(X11BASE)/include

## addtitional library directory
LDIR    = -L$(X11BASE)/lib

## flag to compiler
CFLAG	= -O

## flag to linker
LFLAG	=


##########################################################

##########################################################


###########################################################

OBJS = main.o game.o hero.o floor.o misc.o record.o resource.o key.o

CFLAGS = \
-DRECORD_DIR=\"$(RECORD_DIR)\"	\
-DRECORD_FILE=\"$(RECORD_FILE)\"	\
-DSWAP_FILE=\"$(SWAP_FILE)\"	\
-DLOCK_FILE=\"$(LOCK_FILE)\"	\
-DRECORD_ENTRY=$(RECORD_ENTRY) \
-DRECORD_ENTRY_PRIVATE=$(RECORD_ENTRY_PRIVATE)

.c.o:
	$(CC) -c $(CFLAGS) $(COPT)  $(IDIR)  $<

all : xjumpx


xjumpx : $(OBJS)
	$(CC) -o xjumpx \
		$(OBJS) \
		-lXaw -lXmu -lXt -lXpm -lXext -lX11 $(LDIR)



install	: xjumpx
	install -c -s -g games -m 2755 xjumpx $(TARGET)
	install -d -g games -m 770 $(RECORD_DIR)
	cp xjumpx.1 $(MANDIR) && gzip -f $(MANDIR)/xjumpx.1
	cp XJumpX.ad $(APP_DEFAULTS)/XJumpX



clean:
	rm -rf xjumpx *.o


floor.c	: xjump.h xjump_xlib.h
game.c	: xjump.h key.h hero.c
xjump.h : xjump_xlib.h key.h
key.c	: key.h
main.c	: key.h xjump.h xjump_xlib.h record.h \
	  picture.xpm title.xpm icon.xbm icon_msk.xbm Makefile
record.c: record.h Makefile
