# $Id: Makefile,v 1.9 1995/03/22 06:54:13 m-gniibe Exp m-gniibe $

OBJS= qxtqe_adc.o qxtqe_ah.o qxtqe_bc.o qxtqe_dl.o qxtqe_dlom.o \
	qxtqe_eb.o qxtqe_gim.o qxtqe_ih.o qxtqe_ins.o qxtqe_ip.o \
	qxtqe_iptool.o qxtqe_lk.o qxtqe_lkdata.o qxtqe_math.o qxtqe_om.o \
	qxtqe_omc.o qxtqe_omd.o qxtqe_omn.o qxtqe_omx.o qxtqe_rn.o \
	qxtqe_rndata.o qxtqe_sdif.o qxtqe_sm.o qxtqe_sn.o qxtqe_so.o \
	qxtqe_tp.o qxtqe_tr.o qxtqe_trc.o qxtqe_trceq.o qxtqe_trclp.o \
	qxtqe_trctl.o qxtqe_ud.o qxtqe_udc.o qxtqe_udm.o qxtqe_udn.o \
	qxtqe_udp.o qxtqe_udx.o 

QUIXOTE_TOP= ../
KLIC_CONVERT=klic-convert

PCM=pcm
PCMFLAGS= -Dklic
MAC2H=mac2h.pl

#${OBJS}: debug.h debugwrite.h str.h qe.h explanation.h ip.h pimos.h qeTRC.h

.mac.h:
	${MAC2H} $<
.kh.h:
	${PCM} ${PCMFLAGS} -h $< >$@

###################
.SUFFIXES: .kl1 .kh .mac

KLIC_FOR_QUIXOTE=klic-for-quixote
KFLAGS= -x${QUIXOTE_TOP} ${KLIC_DEBUG_FLAGS}
.kl1.o:
	${KLIC_FOR_QUIXOTE} ${KFLAGS} -c $<

all: ${OBJS}

clean: 
	rm -f *.c *.ext debug.h qe.h qeTRC.h atom.h funct.h ip.h *.o

###################
update-h:
	for file in ../../server/QE-ip/debugwrite.h ../../server/QE-ip/explanation.h ../../server/QE-ip/pimos.h ../../server/QE-ip/str.h; do\
		rm -f `basename $$file`; \
		cp -p $$file `basename $$file`; \
	done
	rm -f debug.h
	${PCM} ${PCMFLAGS} -h ../../server/QE-ip/debug.kh >debug.h
	rm -f ip.h
	${MAC2H} ../../server/QE-ip/ip.mac
	rm -f qe.h
	${MAC2H} ../../server/QE-ip/qe.mac
	rm -f qeTRC.h
	${MAC2H} ../../server/QE-ip/qeTRC.mac

update: update-h
	for file in ../../server/QE-ip/*.kl1; do\
		rm -f `basename $$file`; \
		${KLIC_CONVERT} $$file `basename $$file`; \
	done
	rm -f str.h pimos.h debugwrite.h explanation.h debug.h ip.h qe.h qeTRC.h
