daleken/
daleken/data/notes/
daleken/data/player/
daleken/data/system/poses/
daleken/doc/Homepage/images/
daleken/log/
# Standard Makefile
# Slight modifications should make it possible for this to
# work on most OS's.
# By default this makefile makes a large executable with debugging
# information.  There are optim, profile and archaic options.
#	--Symposium

# Changes you might have to make to password encryption work:
#	1. remove -lcrypt from LINKLIB line
#	2. use crypt.c: add crypt.o to the O_FILES
#	   and crypt.c to the C_FILES
# Try step 1 first, and if that doesn't work, try step 2.

# Choose the option you want to use from the three below, only one can be
# chosen, the preferred one is to have debugging enabled.
PROF    = -pg
DEBUG   = -g3 -DDEBUG
O_FLAGS = -O2

OPTIONAL = $(DEBUG)

# Any library files needed for compilation.
LINKLIB	= -lm -lcrypt

BINDIR	= ../bin
TARGET	= $(BINDIR)/daleken.new
CC     	= cc
MAKE	= make
CFLAGS	= $(OPTIONAL) -Wall
LDFLAGS	= $(OPTIONAL) $(LINKLIB)

# These are the files that are needed, if you add any files to the system
# please add the name to this list.

O_FILES = act_comm.o act_info.o act_fight.o act_move.o act_obj.o act_wiz.o \
	bit.o callback.o comm.o const.o db_io.o db.o event.o fight.o handler.o \
	interp.o magic_def.o magic_misc.o magic_off.o mem.o mob_commands.o \
	mud_prog.o note.o olc.o olc_act.o olc_misc.o olc_save.o regexp.o \
	religion.o save.o special.o ssm.o string.o update.o

C_FILES = act_comm.c, act_info.c act_fight.c act_move.c act_obj.c act_wiz.c \
	bit.c callback.c comm.c const.c db_io.c db.c event.c fight.c handler.c \
	interp.c magic_def.c magic_misc.c magic_off.c mem.c mob_commands.c \
	mud_prog.c note.c olc.c olc_act.c olc_misc.c olc_save.c regexp.c \
	religion.c save.c special.c ssm.c string.c update.c

H_FILES = config.h const.h db.h event.h function.h global.h mud.h olc.h \
	regexp.h types.h

all: $(TARGET)
install: $(TARGET)
$(TARGET): $(O_FILES)
	rm -f $(TARGET)
	$(CC) $(LDFLAGS) -o $(TARGET) $(O_FILES)
	@chmod 664 $(O_FILES)	# -rw-rw-r--
	@chmod 2770 $(TARGET)	# -rwxrws---
#	@$(BINDIR)/tagupdate
#	@$(BINDIR)/buildupdate < ../system/SYSINFO.TXT

%.o: %.c
	$(CC) -c $(CFLAGS) $< -o $@
	@chmod 664 $@		# -rw-rw-r--
#	@touch .build

$(O_FILES): $(H_FILES)

clean:
	rm -f *.o $(TARGET) *.c~ *.h~
#	./tagupdate

## All the strange ways you might like to compile.
# optim - optimised.
# prof - profiling support
# archaic - make it run on a low spec machine (i.e. a 386).

optim:
	@echo You have chosen to optimise the code.
	@echo This means you will probably have to wait a little longer.
	$(MAKE) -k OPTIONAL="$(O_FLAGS)"
	strip $(TARGET)

# Profile Daleken with gprof (GNU profiler)
profile: clean
	$(MAKE) OPTIONAL="$(PROF)"

archaic: clean
	@echo Making a special executable for an older computer.
	$(MAKE) OPTIONAL="$(O_FLAGS) -mno-486"
	strip $(TARGET)

# For all those tags files needed by the good editors.
tags: $(C_FILES) $(H_FILES)
	ctags $(C_FILES) $(H_FILES)

TAGS: $(C_FILES) $(H_FILES)
	etags $(C_FILES) $(H_FILES)