home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / n / tcpip / nfs-serv.1 / nfs-serv / nfs-server-2.1 / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-03-10  |  6.4 KB  |  219 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.           setfsugid.s
  69. XDRFILES    = mount.x nfs_prot.x
  70. GENFILES    = mount.h mount_xdr.c mount_svc.c nfs_prot.h nfs_prot_xdr.c
  71. HDRS        = system.h nfsd.h auth.h fh.h logging.h
  72. LIBHDRS        = fsusage.h getopt.h mountlist.h
  73. MANPAGES    = exports.5 mountd.8 nfsd.8 showmount.8
  74. LIBOBJS        = version.o getopt.o getopt1.o eaccess.o \
  75.           fsusage.o mountlist.o xmalloc.o xstrdup.o \
  76.           nfsmounted.o @LIBOBJS@ @ALLOCA@ \
  77.           setfsugid.o
  78. OBJS        = logging.o fh.o auth_init.o auth_clnt.o
  79. NFSD_OBJS    = nfsd.o dispatch.o getattr.o nfs_prot_xdr.o $(OBJS)
  80. MOUNTD_OBJS    = mountd.o mount_svc.o mount_xdr.o $(OBJS)
  81. SHOWMOUNT_OBJS    = showmount.o mount_xdr.o
  82.  
  83. DISTFILES    = $(SRCS) $(HDRS) $(MANPAGES) \
  84.           $(XDRFILES) $(LIBSRCS) $(LIBHDRS) \
  85.           ChangeLog README NEWS TODO INSTALL COPYING \
  86.           Makefile.in configure.in aclocal.m4 acconfig.h \
  87.           config.h.in configure mkinstalldirs
  88.  
  89. all: $(rpcprefix)mountd $(rpcprefix)nfsd showmount
  90. .PHONY: all
  91.  
  92. .PHONY: info dvi
  93. info: nfs-server.info
  94. dvi: nfs-server.dvi
  95.  
  96. COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $(WARNFLAGS)
  97.  
  98. .c.o:
  99.     $(COMPILE) $<
  100.  
  101. .PHONY: install installdirs
  102. install: installdirs $(rpcprefix)mountd $(rpcprefix)nfsd
  103.     $(INSTALL_PROGRAM) $(rpcprefix)mountd $(bindir)/$(rpcprefix)$(binprefix)mountd
  104.     $(INSTALL_PROGRAM) $(rpcprefix)nfsd $(bindir)/$(rpcprefix)$(binprefix)nfsd
  105.     $(INSTALL_PROGRAM) showmount $(bindir)/$(binprefix)showmount
  106.     $(INSTALL_DATA) $(srcdir)/exports.5 $(man5dir)/$(binprefix)exports$(man5ext)
  107.     $(INSTALL_DATA) $(srcdir)/mountd.8 $(man8dir)/$(binprefix)mountd$(man8ext)
  108.     $(INSTALL_DATA) $(srcdir)/nfsd.8 $(man8dir)/$(binprefix)nfsd$(man8ext)
  109.     $(INSTALL_DATA) $(srcdir)/showmount.8 $(man8dir)/$(binprefix)showmount$(man8ext)
  110.     if [ 'x$(rpcprefix)' != 'x' ]; then \
  111.         rm -f $(man8dir)/$(rpcprefix)$(binprefix)mountd$(man8ext); \
  112.         ln $(man8dir)/$(binprefix)mountd$(man8ext) $(man8dir)/$(rpcprefix)$(binprefix)mountd$(man8ext); \
  113.         rm -f $(man8dir)/$(rpcprefix)$(binprefix)nfsd$(man8ext); \
  114.         ln $(man8dir)/$(binprefix)nfsd$(man8ext) $(man8dir)/$(rpcprefix)$(binprefix)nfsd$(man8ext); \
  115.     fi
  116. installdirs:
  117.     ${srcdir}/mkinstalldirs $(bindir) $(man5dir) $(man8dir)
  118.  
  119. $(rpcprefix)mountd: $(MOUNTD_OBJS) libns.a
  120.     $(CC) $(LDFLAGS) -o $@ $(MOUNTD_OBJS) $(LIBS)
  121.  
  122. $(rpcprefix)nfsd: $(NFSD_OBJS) libns.a
  123.     $(CC) $(LDFLAGS) -o $@ $(NFSD_OBJS) $(LIBS)
  124.  
  125. showmount: $(SHOWMOUNT_OBJS) libns.a
  126.     $(CC) $(LDFLAGS) -o $@ $(SHOWMOUNT_OBJS) $(LIBS)
  127.  
  128. nfs_prot.h: nfs_prot.x
  129.     rm -f $@
  130.     $(RPCGEN) -h -o $@ $?
  131. nfs_prot_xdr.c: nfs_prot.x
  132.     rm -f $@
  133.     $(RPCGEN) -c $? | \
  134.         sed 's;^#include ".*/nfs_prot.h"$$;#include "nfs_prot.h";' >$@
  135.  
  136. mount.h: mount.x
  137.     rm -f $@
  138.     $(RPCGEN) -h -o $@ $?
  139. mount_xdr.c: mount.x
  140.     rm -f $@
  141.     $(RPCGEN) -c $? | \
  142.           sed 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  143. mount_svc.c: mount.x
  144.     rm -f $@
  145.     $(RPCGEN) $(TRANSPORTFLAGS) $? | \
  146.         sed -e 's/main/mountd_&/' \
  147.             -e 's/static int _rpc/int _rpc/' \
  148.             -e 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  149.     if grep 'int _rpcfdtype' $@ >/dev/null; then \
  150.         :; \
  151.     else \
  152.         echo 'int _rpcfdtype;' >tmp; \
  153.         cat $@ >>tmp; \
  154.         mv tmp $@; \
  155.     fi
  156.  
  157. nfs_prot_xdr.o: nfs_prot_xdr.c
  158.     $(COMPILE) $(RPC_WARNFLAGS) -c nfs_prot_xdr.c
  159. mount_xdr.o: mount_xdr.c
  160.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_xdr.c
  161. mount_svc.o: mount_svc.c
  162.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_svc.c
  163.  
  164. $(MOUNTD_OBJS): config.h nfs_prot.h mount.h
  165. $(NFSD_OBJS): config.h nfs_prot.h mount.h
  166. $(SHOWMOUNT_OBJS): config.h mount.h
  167.  
  168. libns.a: $(LIBOBJS)
  169.     rm -f $@
  170.     $(AR) cr $@ $(LIBOBJS)
  171.     -$(RANLIB) $@
  172.  
  173. nfs-server.info: nfs-server.texi
  174.     $(MAKEINFO) -I$(srcdir) -o nfs-server.info $(srcdir)/nfs-server.texi
  175. nfs-server.dvi: nfs-server.texi
  176.     $(TEXI2DVI) $(srcdir)/nfs-server.texi
  177.  
  178. .PHONY: check
  179. check: nfs-server
  180.     @echo nothing to check
  181.  
  182. Makefile: Makefile.in config.h.in config.status
  183.     $(SHELL) config.status
  184. config.status: configure
  185.     $(SHELL) config.status --recheck
  186. configure: configure.in aclocal.m4
  187.     cd $(srcdir) && autoconf
  188. config.h.in: configure.in acconfig.h
  189.     cd $(srcdir) && autoheader
  190.  
  191. TAGS: $(SRCS)
  192.     etags $(SRCS)
  193.  
  194. .PHONY: clean mostlyclean distclean realclean dist
  195.  
  196. clean:
  197.     rm -f $(rpcprefix)mountd $(rpcprefix)nfsd showmount *.o libns.a core
  198.     rm -f nfs-server.dvi nfs-server.?? nfs-server.??s
  199.     rm -f $(GENFILES)
  200.  
  201. mostlyclean: clean
  202.  
  203. distclean: clean
  204.     rm -f Makefile config.status
  205.  
  206. realclean: distclean
  207.     rm -f TAGS nfs-server.info*
  208.  
  209. dist: $(DISTFILES)
  210.     echo nfs-server-`sed -e '/version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
  211.     rm -rf `cat .fname`
  212.     mkdir `cat .fname`
  213.     ln $(DISTFILES) `cat .fname`
  214.     tar chzf `cat .fname`.tar.gz `cat .fname`
  215.     rm -rf `cat .fname` .fname
  216.  
  217. # Prevent GNU make v3 from overflowing arg limit on SysV.
  218. .NOEXPORT:
  219.