Listing 5: makefile
CC=gcc
RPCGEN=rpcgen
PROGS=checktool checker_svc
INSTALL=install
INSTALL_PATH=/etc
#
# For SVR4 rpcgen such as Solaris 2.x
#
#RPCGEN_FLAGS= -K 30
#RPCLIB=-lrpcsvc -lnsl
#CFLAGS = -g -DSVR4
#
# For SunOS 4.1.x machines
#
RPCGEN_FLAGS= -I -K 30
CFLAGS = -g
RPCLIB=
all: $(PROGS)
checktool : checker_xdr.o checker_clnt.o checktool.o
$(CC) $(CFLAGS) -o checktool checktool.o \
checker_clnt.o checker_xdr.o $(RPCLIB)
checker_svc : checker_xdr.o checker_svc.o checker_proc.o
$(CC) $(CFLAGS) -o checker_svc checker_svc.o \
checker_proc.o checker_xdr.o $(RPCLIB)
checker_svc.o : checker_svc.c
$(CC) $(CFLAGS) -c checker_svc.c
checker_proc.o : checker_proc.c
$(CC) $(CFLAGS) -c checker_proc.c
checktool.o : checktool.c
$(CC) $(CFLAGS) -c checktool.c
checker_clnt.o : checker_clnt.c
$(CC) $(CFLAGS) -c checker_clnt.c
check_modes.o : check_modes.c
$(CC) $(CFLAGS) -c check_modes.c
checker_xdr.o: checker.x
$(RPCGEN) $(RPCGEN_FLAGS) checker.x
$(CC) -c checker_xdr.c
clean:
/bin/rm *.o checker_svc.c checker.h checker_xdr.c \
checker_clnt.c $(PROGS)
install : checker_svc checktool
$(INSTALL) checker_svc $(INSTALL_PATH)/
$(INSTALL) checktool /usr/local/etc/
|