# makefile adapted by SledgeHam 

INSTALLDIR=$$HOME/mud/areas
INSTALLDIR2=$$HOME/mud/areas/mmerc
CC = gcc
PROF =
DEBUG = -g -ggdb
C_FLAGS = -O $(PROF) -DMALLOC_DEBUG
L_FLAGS = -O $(PROF) -DMALLOC_DEBUG


O_FILES = def.o db2_var.o db2_1.o db2_2.o ac.o ai.o am.o ao.o ar.o aw.o bit.o board.o comm.o \
          fgt.o hnd.o int.o mem.o mgc.o  oc.o scr.o spec.o       \
          str.o  sv.o upd.o xrand.o new_cmd.o lang.o roomscr.o oc2.o

# how to use this makefile :
# to make executable    make all
# to cleanup            make clean


info:
	@echo ""
	@echo "use make all to compile sources .."
	@echo "    make install to copy the executable .."
	@echo "    make clean to remove files when comilation is done"
	@echo "    make depend to make dependencies correct"
	@echo
	@echo "first make sure u use the right libs (Pico Makefile)"
	@echo look foor LIBS
	@echo
	@echo good luck ..
	@echo 
	@echo "                             - Grok NiMUD Team"

all: merc

test: merc
	cp merc ../areas/merc_test
	cd ../areas;merc_test 2000

depend:
	makedepend -I/usr/ucbinclude *.c

#remove all files not needed anylonger when exec is built
clean:
	rm -f $(O_FILES) core ../lib/core
	purge


merc: $(O_FILES)
	rm -f merc
	$(CC) $(DEBUG) -fwritable-strings -o merc -O $(O_FILES) $(LIBS)

install: merc
	cp merc $(INSTALLDIR)

install2: merc
	cp merc $(INSTALLDIR2)

.c.o:
	$(CC) $(DEBUG) -c -fwritable-strings $<

.INOBJECTDIR: $(O_FILES)


