
LINKS=	ss/ss.h ss/ss_err.h ss/mit-sipb-copyright.h com_err.h \
	usp/usp.h usp/usp_et.h rpc_et.h discuss/dsc_et.h usp.h usp_et.h \
	discuss_err.h ss.h
FILES=	ansi.h atom.h globals.h internal.h mit-copyright.h \
	rpc.h trn_spec.h \
	discuss/acl.h discuss/discuss.h discuss/dsname.h discuss/interface.h \
	discuss/mit-sipb-copyright.h discuss/tfile.h discuss/types.h

all : $(LINKS)

ss:
	mkdir ss

ss/ss.h: ss ../ss/ss.h
	rm -f ss/ss.h
	ln -s ../../ss/ss.h ss/

ss/ss_err.h: ss ../ss/ss_err.h
	rm -f ss/ss_err.h
	ln -s ../../ss/ss_err.h ss/

ss/mit-sipb-copyright.h: ss ../ss/mit-sipb-copyright.h
	rm -f ss/mit-sipb-copyright.h
	ln -s ../../ss/mit-sipb-copyright.h ss/

ss.h:
	rm -f ss.h
	ln -s ss/ss.h .

com_err.h: ../et/com_err.h
	rm -f com_err.h
	ln -s ../et/com_err.h .

usp:
	mkdir usp

usp/usp.h: usp ../usp/usp.h
	rm -f usp/usp.h
	ln -s ../../usp/usp.h usp/

usp.h:	usp/usp.h
	rm -f usp.h
	ln -s usp/usp.h .

usp/usp_et.h: usp ../ets/usp_et.h
	rm -f usp/usp_et.h
	ln -s ../../ets/usp_et.h usp/

usp_et.h: usp/usp_et.h
	rm -f usp_et.h
	ln -s usp/usp_et.h .

rpc_et.h: ../ets/rpc_et.h
	rm -f rpc_et.h
	ln -s ../ets/rpc_et.h .

discuss/dsc_et.h: ../ets/dsc_et.h
	rm -f discuss/dsc_et.h
	ln -s ../../ets/dsc_et.h discuss/

discuss_err.h:	../ets/discuss_err.h
	rm -f discuss_err.h
	ln -s ../ets/discuss_err.h .

clean:
	rm -rf ss usp $(LINKS) *~ discuss/*~

dist:	$(FILES) config.h Makefile
	-mkdir ../../dist/source/include
	-mkdir ../../dist/source/discuss
	cp config.h config.h.orig
	tar cfr - config.h.orig Makefile $(FILES) | \
		(cd ../../dist/source/include;tar xfp -)
	rm config.h.orig
	
depend:	$(LINKS)	# so others can make "depend" properly
