#
# makefile for emp commands
#

#BEGINMOD 		-do not remove this line
#  configuration data from the main makefile
#  will go here
#ENDOFMOD		-do not remove this line

CFLAGS= -I../../h ${GLOBALCFLAGS}
DEPEND= ../../BIN/depend${BSD}

CFILES = head.c news.c desi.c nati.c give.c map.c buil.c shi.c \
	cens.c rea.c move.c tran.c add.c new.c tele.c nuke.c \
	real.c comm.c

OFILES = head.o news.o desi.o nati.o give.o map.o buil.o shi.o \
	cens.o rea.o move.o tran.o add.o new.o tele.o nuke.o \
	real.o comm.o

LIB = ../empcom.a

$(LIB):	$(P) $(OFILES)
	ar r $(LIB) $(OFILES)
	ranlib $(LIB)

../empcom.o:	$(OFILES)
	$(LD) -X -r -o ../empcom.o $(OFILES)

lintlib: llib-lCOMS.ln
llib-lCOMS.ln: $(CFILES)
	lint -I.. -CCOMS $(CFILES)
	@rm -f ../../$@
	@ln $@ ../../$@

saber:
	#load $(CFLAGS) $(CFILES)

lint:	$(CFILES)
	lint -I.. -bhuz $(CFILES) ../../llib-lSUBS.ln

tags:.
	@ln -s ../../tags
	ctags -a *.c

clean:;
	rm -f $(LIB) $(OFILES)
	@echo "clearing cruft out of Makefile"
	@rm -f HO
	@touch HO
	@echo "/^#DEPEND START/" >> HO
	@echo '.,/#DEPEND END/d' >> HO
	@echo "i" >> HO
	@echo '#DEPEND START' >>HO
	@echo '#DEPEND END' >>HO
	@echo "." >> HO
	@echo "wq" >> HO
	@ex - Makefile < HO > /dev/null
	rm -f .Makefile.bak HO

depend: 
	@rm -f .Makefile.bak
	cp Makefile .Makefile.bak
	@echo "making editing changes file"
	@rm -f HO
	@touch HO
	@echo "/^#DEPEND START/" >> HO
	@echo '.,/#DEPEND END/d' >> HO
	@echo "i" >> HO
	@echo '#DEPEND START' >>HO
	cc -M ${CFLAGS} ${CFILES} >>HO
	@echo '#DEPEND END' >>HO
	@echo "." >> HO
	@echo "wq" >> HO
	ex - Makefile < HO > /dev/null
	@rm -f HO

#DEPEND START
#DEPEND END


