home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / n / tcpip / netkit-a.06 / netkit-a / NetKit-A-0.06 / nfs-server-2.0 / Makefile.in < prev    next >
Encoding:
Makefile  |  1994-07-02  |  6.1 KB  |  211 lines

  1. # Makefile for the Universal NFS Server.    -*- Indented-Text -*-
  2. # Copyright (C) 1993 Rick Sladkey.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #### Start of system configuration section. ####
  19.  
  20. VPATH = @srcdir@
  21. srcdir = $(VPATH)
  22.  
  23. CC = @CC@
  24. AR = ar
  25. RANLIB = @RANLIB@
  26.  
  27. INSTALL = @INSTALL@
  28. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  29. INSTALL_DATA = @INSTALL_DATA@
  30. MAKEINFO = makeinfo
  31. TEXI2DVI = texi2dvi
  32. RPCGEN = @RPCGEN@ @RPCGEN_C@
  33.  
  34. DEFS = @DEFS@
  35. LIBS = libns.a @LIBS@
  36.  
  37. CFLAGS = -g
  38. LDFLAGS = -g
  39. WARNFLAGS = @WARNFLAGS@
  40. RPC_WARNFLAGS = @RPC_WARNFLAGS@
  41. TRANSPORTFLAGS = @RPCGEN_I@ -s udp -s tcp
  42.  
  43. prefix = /usr/local
  44. exec_prefix = $(prefix)
  45.  
  46. bindir = $(exec_prefix)/etc
  47. infodir = $(prefix)/info
  48. man5dir = $(prefix)/man/man5
  49. man5ext = .5
  50. man8dir = $(prefix)/man/man8
  51. man8ext = .8
  52.  
  53. # Prefix to be prepended to each installed RPC program, normally `rpc.'.
  54. rpcprefix = rpc.
  55. # Prefix to be prepended to each installed program, normally empty or `g'.
  56. binprefix = 
  57.  
  58. #### End of system configuration section. ####
  59.  
  60. SHELL = /bin/sh
  61.  
  62. SRCS        = version.c logging.c fh.c auth_init.c auth_clnt.c \
  63.           nfsd.c dispatch.c getattr.c mountd.c showmount.c
  64. LIBSRCS        = fileblocks.c fsusage.c realpath.c strerror.c \
  65.           utimes.c mkdir.c rename.c getopt.c getopt1.c \
  66.           alloca.c eaccess.c mountlist.c xmalloc.c \
  67.           xstrdup.c strdup.c strstr.c nfsmounted.c
  68. XDRFILES    = mount.x nfs_prot.x
  69. GENFILES    = mount.h mount_xdr.c mount_svc.c nfs_prot.h nfs_prot_xdr.c
  70. HDRS        = system.h nfsd.h auth.h fh.h logging.h
  71. LIBHDRS        = fsusage.h getopt.h mountlist.h
  72. MANPAGES    = exports.5 mountd.8 nfsd.8 showmount.8
  73. LIBOBJS        = version.o getopt.o getopt1.o eaccess.o \
  74.           fsusage.o mountlist.o xmalloc.o xstrdup.o \
  75.           nfsmounted.o @LIBOBJS@ @ALLOCA@
  76. OBJS        = logging.o fh.o auth_init.o auth_clnt.o
  77. NFSD_OBJS    = nfsd.o dispatch.o getattr.o nfs_prot_xdr.o $(OBJS)
  78. MOUNTD_OBJS    = mountd.o mount_svc.o mount_xdr.o $(OBJS)
  79. SHOWMOUNT_OBJS    = showmount.o mount_xdr.o
  80.  
  81. DISTFILES    = $(SRCS) $(HDRS) $(MANPAGES) \
  82.           $(XDRFILES) $(LIBSRCS) $(LIBHDRS) \
  83.           ChangeLog README NEWS TODO INSTALL COPYING \
  84.           Makefile.in configure.in aclocal.m4 acconfig.h \
  85.           config.h.in configure mkinstalldirs
  86.  
  87. all: $(rpcprefix)mountd $(rpcprefix)nfsd showmount
  88. .PHONY: all
  89.  
  90. .PHONY: info dvi
  91. info: nfs-server.info
  92. dvi: nfs-server.dvi
  93.  
  94. COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $(WARNFLAGS)
  95.  
  96. .c.o:
  97.     $(COMPILE) $<
  98.  
  99. .PHONY: install installdirs
  100. install: installdirs $(rpcprefix)mountd $(rpcprefix)nfsd
  101.     $(INSTALL_PROGRAM) $(rpcprefix)mountd $(bindir)/$(rpcprefix)$(binprefix)mountd
  102.     $(INSTALL_PROGRAM) $(rpcprefix)nfsd $(bindir)/$(rpcprefix)$(binprefix)nfsd
  103.     $(INSTALL_PROGRAM) showmount $(bindir)/$(binprefix)showmount
  104.     $(INSTALL_DATA) $(srcdir)/exports.5 $(man5dir)/$(binprefix)exports$(man5ext)
  105.     $(INSTALL_DATA) $(srcdir)/mountd.8 $(man8dir)/$(rpcprefix)$(binprefix)mountd$(man8ext)
  106.     $(INSTALL_DATA) $(srcdir)/nfsd.8 $(man8dir)/$(rpcprefix)$(binprefix)nfsd$(man8ext)
  107.     $(INSTALL_DATA) $(srcdir)/showmount.8 $(man8dir)/$(binprefix)showmount$(man8ext)
  108. installdirs:
  109.     ${srcdir}/mkinstalldirs $(bindir) $(man5dir) $(man8dir)
  110.  
  111. $(rpcprefix)mountd: $(MOUNTD_OBJS) libns.a
  112.     $(CC) $(LDFLAGS) -o $@ $(MOUNTD_OBJS) $(LIBS)
  113.  
  114. $(rpcprefix)nfsd: $(NFSD_OBJS) libns.a
  115.     $(CC) $(LDFLAGS) -o $@ $(NFSD_OBJS) $(LIBS)
  116.  
  117. showmount: $(SHOWMOUNT_OBJS) libns.a
  118.     $(CC) $(LDFLAGS) -o $@ $(SHOWMOUNT_OBJS) $(LIBS)
  119.  
  120. nfs_prot.h: nfs_prot.x
  121.     rm -f $@
  122.     $(RPCGEN) -h -o $@ $?
  123. nfs_prot_xdr.c: nfs_prot.x
  124.     rm -f $@
  125.     $(RPCGEN) -c $? | \
  126.         sed 's;^#include ".*/nfs_prot.h"$$;#include "nfs_prot.h";' >$@
  127.  
  128. mount.h: mount.x
  129.     rm -f $@
  130.     $(RPCGEN) -h -o $@ $?
  131. mount_xdr.c: mount.x
  132.     rm -f $@
  133.     $(RPCGEN) -c $? | \
  134.           sed 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  135. mount_svc.c: mount.x
  136.     rm -f $@
  137.     $(RPCGEN) $(TRANSPORTFLAGS) $? | \
  138.         sed -e 's/main/mountd_&/' \
  139.             -e 's/static int _rpc/int _rpc/' \
  140.             -e 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  141.     if grep 'int _rpcfdtype' $@ >/dev/null; then \
  142.         :; \
  143.     else \
  144.         echo 'int _rpcfdtype;' >tmp; \
  145.         cat $@ >>tmp; \
  146.         mv tmp $@; \
  147.     fi
  148.  
  149. nfs_prot_xdr.o: nfs_prot_xdr.c
  150.     $(COMPILE) $(RPC_WARNFLAGS) -c nfs_prot_xdr.c
  151. mount_xdr.o: mount_xdr.c
  152.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_xdr.c
  153. mount_svc.o: mount_svc.c
  154.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_svc.c
  155.  
  156. $(MOUNTD_OBJS): config.h nfs_prot.h mount.h
  157. $(NFSD_OBJS): config.h nfs_prot.h mount.h
  158. $(SHOWMOUNT_OBJS): config.h mount.h
  159.  
  160. libns.a: $(LIBOBJS)
  161.     rm -f $@
  162.     $(AR) cr $@ $(LIBOBJS)
  163.     -$(RANLIB) $@
  164.  
  165. nfs-server.info: nfs-server.texi
  166.     $(MAKEINFO) -I$(srcdir) -o nfs-server.info $(srcdir)/nfs-server.texi
  167. nfs-server.dvi: nfs-server.texi
  168.     $(TEXI2DVI) $(srcdir)/nfs-server.texi
  169.  
  170. .PHONY: check
  171. check: nfs-server
  172.     @echo nothing to check
  173.  
  174. Makefile: Makefile.in config.h.in config.status
  175.     $(SHELL) config.status
  176. config.status: configure
  177.     $(SHELL) config.status --recheck
  178. configure: configure.in aclocal.m4
  179.     cd $(srcdir) && autoconf
  180. config.h.in: configure.in acconfig.h
  181.     cd $(srcdir) && autoheader
  182.  
  183. TAGS: $(SRCS)
  184.     etags $(SRCS)
  185.  
  186. .PHONY: clean mostlyclean distclean realclean dist
  187.  
  188. clean:
  189.     rm -f $(rpcprefix)mountd $(rpcprefix)nfsd showmount *.o libns.a core
  190.     rm -f nfs-server.dvi nfs-server.?? nfs-server.??s
  191.     rm -f $(GENFILES)
  192.  
  193. mostlyclean: clean
  194.  
  195. distclean: clean
  196.     rm -f Makefile config.status config.h
  197.  
  198. realclean: distclean
  199.     rm -f TAGS nfs-server.info*
  200.  
  201. dist: $(DISTFILES)
  202.     echo nfs-server-`sed -e '/version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
  203.     rm -rf `cat .fname`
  204.     mkdir `cat .fname`
  205.     ln $(DISTFILES) `cat .fname`
  206.     tar chzf `cat .fname`.tar.gz `cat .fname`
  207.     rm -rf `cat .fname` .fname
  208.  
  209. # Prevent GNU make v3 from overflowing arg limit on SysV.
  210. .NOEXPORT:
  211.