#
# @(#)Makefile	1.2 87/11/09 3.9 RPCSRC
#
# Makefile for rpc protocol compiler
# Copyright (C) 1987, Sun Microsystems, Inc.
#
srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.lwp


SRCS= rpc_main.c rpc_hout.c rpc_cout.c rpc_parse.c rpc_scan.c rpc_util.c
HDRS= rpc_util.h rpc_parse.h rpc_scan.h
OBJS= rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o rpc_scan.o rpc_util.o

all: rxgen ${TOP_INCDIR}/afs/rxgen_consts.h

buildtools: rxgen

${TOP_INCDIR}/afs/rxgen_consts.h: rxgen_consts.h
	${INSTALL_DATA} $? $@

rxgen: $(OBJS) AFS_component_version_number.c $(HDRS)
	$(AFS_LDRULE) $(OBJS) $(XLIBS)

CFLAGS_rpc_main.o= -DPATH_CPP="\"$(PATH_CPP)\""

#
# Install targets
#
install: rxgen rxgen_consts.h
	${INSTALL} -d ${DESTDIR}${bindir}
	${INSTALL} -d ${DESTDIR}${includedir}/afs
	${INSTALL_PROGRAM} rxgen ${DESTDIR}${bindir}/rxgen
	${INSTALL_DATA} ${srcdir}/rxgen_consts.h \
		${DESTDIR}${includedir}/afs/rxgen_consts.h

dest: rxgen rxgen_consts.h
	${INSTALL} -d ${DEST}/bin
	${INSTALL} -d ${DEST}/include/afs
	${INSTALL_PROGRAM} rxgen ${DEST}/bin/rxgen
	${INSTALL_DATA} ${srcdir}/rxgen_consts.h ${DEST}/include/afs/rxgen_consts.h

#
# Misc. targets
#
clean:
	$(RM) -f *.o rxgen core AFS_component_version_number.c

include ../config/Makefile.version
