home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / f / futi14as.zip / MAKEFILE < prev    next >
Text File  |  1992-02-22  |  6KB  |  227 lines

  1. # Makefile for fileutils (MS-DOS)
  2. # Copyright (C) 1986, 1988, 1989 Free Software Foundation, Inc.
  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 1, 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. # MS-DOS port (c) 1990 by Thorsten Ohl, ohl@gnu.ai.mit.edu
  19. # This port is also distributed under the terms of the
  20. # GNU General Public License as published by the
  21. # Free Software Foundation.
  22.  
  23. # Please note that this file is not identical to the
  24. # original GNU release, you should have received this
  25. # code as patch to the official release.
  26.  
  27. # $Header: e:/gnu/fileutil/RCS/makefile 1.4.0.3 90/09/19 13:27:14 tho Exp $
  28.  
  29. VPATH    = d:/usr/lib;d:/usr/include
  30.  
  31. INSTALL = cp -v
  32. DISK    = b:
  33. ZIPFILE = fileutil.zip
  34.  
  35. MODEL    = S
  36. model    = s
  37.  
  38. # You'll need the gnulib, featuring:
  39. # _cwild.c, error.c, getopt.c, getopt.h, getopt1.c, glob.c, gnulib.h,
  40. # ndir.c, ndir.h, pwd.c, pwd.h, regex.c, regex.h, xmalloc.c, xrealloc.c
  41.  
  42. GNULIB    = gnulib_$(model)
  43.  
  44. DEFINES    = -DVPRINTF -DUTIMES_MISSING -DFCHMOD_MISSING -DSTDC_HEADERS \
  45.       -DINT_16_BITS -DUSG -DBLKSIZE=0x4000 -DSMART_SHELL
  46.  
  47. BUILD    = production
  48.  
  49. ifeq ($(BUILD),debug)
  50. CFLAGS    = -A$(MODEL) -Za -Od -Zi -W4 $(DEFINES)
  51. LDFLAGS    = /co/noe setargv
  52. else
  53. CFLAGS    = -A$(MODEL) -Za -Ox -W4 $(DEFINES)
  54. LDFLAGS    = /e/noe/far/packcode setargv
  55. endif
  56.  
  57. # for malloc()'ing programs
  58. SSTACK    = /st:0x4000
  59. # for alloca()'ing programs (incl. `auto' allocation)
  60. BSTACK    = /st:0x8000
  61.  
  62. # Where to install the executables
  63. BINDIR    = c:/bin
  64.  
  65. # Executable files in this directory
  66.  
  67. CMDS    = $(CMDS1) $(CMDS2) $(CMDS3) $(CMDS4) $(CMDS5)
  68.  
  69. # These are designed to give < 100k .tar.Z.uue files.
  70.  
  71. CMDS1    = cat.exe chmod.exe cmp.exe cp.exe
  72. CMDS2    = cut.exe dir.exe dd.exe head.exe
  73. CMDS3    = ls.exe mkdir.exe mv.exe paste.exe
  74. CMDS4    = rm.exe rmdir.exe tac.exe
  75. CMDS5    = tail.exe touch.exe vdir.exe
  76.  
  77. # Sources
  78.  
  79. SRCS    = argmatch.c backupfi.c cat.c chmod.c cmp.c cp-aux.c cp.c cut.c \
  80.       dd.c eaccess.c filebloc.c filemode.c getversi.c head.c ls.c \
  81.       mkdir.c modechan.c mv.c paste.c rm.c rmdir.c savedir.c tac.c \
  82.       tail.c touch.c getdate.y posixtim.y
  83. INCS    = backupfi.h cp.h modechan.h system.h
  84.  
  85. UNUSED    = cp-hash.c dirlib.c du.c error.c getopt.c getopt.h getopt1.c \
  86.       globmat.c install.c ln.c mkfifo.c mktime.c mvdir.c regex.c regex.h
  87.  
  88. DOCS    = fileutil.pl
  89. MPAGES    = gcat.1 gchmod.1 gcmp.1 gcp.1 gcut.1 gdd.1 gdu.1 ghead.1 \
  90.       ginstall.1 gln.1 gls.1 gmkdir.1 gmkfifo.1 gmv.1 gpaste.1 \
  91.       grm.1 grmdir.1 gtac.1 gtail.1 gtouch.1
  92. MANDIR    = man
  93. MANPAGES= $(addprefix $(MANDIR)/,$(MPAGES))
  94.  
  95. RCSFILES= $(addprefix RCS/, $(SRCS) $(INCS) $(DOCS) makefile readme) \
  96.       $(MANPAGES)
  97. MISC    = changelo todo makepat mkpatch RCS/tar_-tv
  98.  
  99. TARFILES= makefile fileutil.pl patches
  100. PATCHES    = fileutil
  101. BINARIES= $(addprefix futil-b, 1 2 3 4 5)
  102.  
  103. # Version of fileutils release
  104.  
  105. VERSION = 1.4
  106.  
  107. # Targets
  108.  
  109. .PHONY: all install
  110. all: $(CMDS)
  111. install: $(addprefix $(BINDIR)/, $(CMDS))
  112.  
  113. $(BINDIR)/% : %
  114.     $(INSTALL) $< $@
  115.  
  116. # Linking rules
  117.  
  118. %.exe: %.obj
  119.     $(LINK) $(LDFLAGS) $(BSTACK) $^, $@, nul, $(GNULIB),
  120.  
  121. cmp.exe: cmp.obj _cwild.obj
  122.     $(LINK) $(LDFLAGS) $(SSTACK) $^, $@, nul, $(GNULIB),
  123.  
  124. $(CMDS): _cwild.obj
  125.  
  126. chmod.exe: filemode.obj modechan.obj savedir.obj
  127. cp.exe: argmatch.obj backupfi.obj cp-aux.obj eaccess.obj getversi.obj \
  128.     savedir.obj # cp-hash.obj
  129. dir.exe ls.exe vdir.exe: argmatch.obj filebloc.obj filemode.obj
  130. mkdir.exe: modechan.obj
  131. mv.exe: argmatch.obj backupfi.obj getversi.obj
  132. rm.exe: eaccess.obj
  133. touch.exe: argmatch.obj getdate.obj posixtim.obj
  134.  
  135. # Compilation rules
  136.  
  137. dir.obj: ls.c
  138.     $(CC) $(CFLAGS) -DMULTI_COL -c -Fo$@ ls.c
  139.  
  140. vdir.obj: ls.c
  141.     $(CC) $(CFLAGS) -DLONG_FORMAT -c -Fo$@ ls.c
  142.  
  143. $(SRCS:.c=.obj): system.h
  144. chmod.obj mkdir.obj modechan.obj: modechan.h
  145. backupfi.obj cp.obj getversi.obj mv.obj: backupfi.h
  146. cp.obj cp-aux.obj cp-hash.obj : cp.h
  147.  
  148.  
  149. # Documentation (requires Larry Wall's `perl').
  150.  
  151. .PHONY: docs info tex
  152. docs: info tex
  153. info: fileutil.inf
  154. tex: fileutil.dvi
  155.  
  156. fileutil.dvi: fileutil.tex fileutil.pgs
  157.     tex $<
  158.  
  159. fileutil.pgs: fileutil.pg
  160.     texindex $^
  161.  
  162. fileutil.pg: fileutil.tex
  163.     tex $<
  164.  
  165. fileutil.inf: fileutil.tex
  166.     makeinfo $<
  167.  
  168. fileutil.tex: fileutil.pl $(MANPAGES)
  169.     perl $< MANDIR=$(MANDIR) > $@
  170.  
  171. # Cleanup, Backup, Patches
  172.  
  173. .PHONY: clean veryclean
  174. clean:
  175.     rm -f *.obj *.map *~ *.tar *.cp *.fn *.ky *.pg *.pgs *.tp *.vr \
  176.           *.tex *.aux *.toc *.dvi *.log *.dlg
  177.  
  178. veryclean: clean
  179.     rm -f *.uue *.exe *.inf errs tags
  180.     rcsclean *.c *.h *.y *.pl makefile
  181.  
  182. .PHONY: zip disk
  183. zip: $(ZIPFILE)
  184. disk: $(DISK)/$(ZIPFILE)
  185.  
  186. $(ZIPFILE): $(RCSFILES) $(MISC)
  187.     pkzip -r- -P $@ $?
  188.  
  189. $(DISK)/$(ZIPFILE): $(ZIPFILE)
  190.     cp $< $@
  191.     pkunzip -t $@ | grep -vw OK
  192.  
  193. tags: $(SRCS) $(INCS)
  194.     etags -t *.h *.c
  195.  
  196.  
  197. .PHONY: dist
  198. dist: $(addsuffix .uue, $(PATCHES) $(BINARIES))
  199.  
  200. %.uue: %.tar
  201.     compress < $< | uuencode $<.Z > $@
  202.  
  203. %.tar:
  204.     tar -cf $@ $^
  205.  
  206. $(PATCHES).tar: readme copying $(TARFILES)
  207. futil-b1.tar: readme copying $(CMDS1)
  208. futil-b2.tar: readme copying $(CMDS2)
  209. futil-b3.tar: readme copying $(CMDS3)
  210. futil-b4.tar: readme copying $(CMDS4)
  211. futil-b5.tar: readme copying $(CMDS5)
  212.  
  213. patches: $(SRCS) $(INCS) $(RCSFILES)
  214.     rcsdiff -c -r$(VERSION) *.[chy] > $@
  215.  
  216. .PHONY: test-dist
  217. test-dist: $(PATCHES).uue $(RCSFILES)
  218.     $(CO) -f -r$(VERSION) $(SRCS) $(INCS)
  219.     sed /\.tar\.Z/s//.Z/ $(PATCHES).uue | uudecode
  220.     compress -d < $(PATCHES).Z | tar -xOf -  patches | patch -s
  221.     rcsdiff -q $(SRCS) $(INCS)
  222.  
  223. .PHONY: cheat
  224. cheat:
  225.     $(INSTALL) $(addprefix $(BINDIR)/, $(CMDS)) .
  226.  
  227.