home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / s / sort03as.zip / MAKEFILE < prev    next >
Text File  |  1990-08-26  |  4KB  |  137 lines

  1. # Makefile for GNU sort
  2. # Copyright 1989 (C) 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, td12@ddagsi3.bitnet
  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. # $Header: e:/gnu/sort/RCS/makefile.'v 0.3.0.4 90/08/26 19:10:03 tho Rel $
  24.  
  25. # Interesting targets:
  26. #
  27. #    all (default, makes sort.exe)
  28. #    docs (makes sort.dvi and sort.inf)
  29. #    tags (creates tags)
  30. #    install (put sort.exe into BINDIR)
  31. #
  32.  
  33. PROGRAM    = sort
  34.  
  35. # Where to find library objects, includes, or sources
  36. VPATH    = d:/usr/lib;d:/usr/include
  37.  
  38. # Where to put the executable
  39. BINDIR    = c:/bin
  40.  
  41. INSTALL = cp -v
  42. DISK    = b:
  43. ZIPFILE = $(PROGRAM).zip
  44.  
  45. #BUILD    = debug
  46. BUILD    = production
  47.  
  48. ifeq ($(BUILD),debug)
  49. CFLAGS    = -AC -W4 -Od -Zi -Za -DSTDC_HEADERS -DUSG
  50. LDFLAGS = /co/st:0x8000/noe
  51. else
  52. # Don't use -Oe (global register allocation):
  53. # > sort.c(1106) : fatal error C1001: Internal Compiler Error  
  54. # >                (compiler file '../grammar.c', line 140)   
  55. # >                Contact Microsoft Product Support Services 
  56. # We also refrain from removing the stackprobes for the momemt, until we
  57. # figured out how deeply the program recurses...
  58. CFLAGS    = -AC -W4 -Ocgilt -Za -DSTDC_HEADERS -DUSG
  59. LDFLAGS = /e/st:0x8000/noe
  60. endif
  61.  
  62. OBJS    = sort.obj
  63. SRCS    = sort.c std.h
  64. LIBS    = glob.obj msd_dir.obj _cwild.obj
  65.  
  66. RCSFILES= $(patsubst %, RCS/%'v, $(SRCS)) RCS/makefile.'v
  67. MISC    = RCS/todo'v RCS/perf'v RCS/sort.t'v todo.dos changelo
  68.  
  69. DIST_FILES = readme sort.tex sort.inf makefile $(SRCS)
  70.  
  71. .PHONY: all
  72. all: $(PROGRAM).exe
  73.  
  74. $(PROGRAM).exe: $(OBJS) $(LIBS)
  75.     $(LINK) $(LDFLAGS) $^ setargv, $@;
  76.  
  77. sort.obj: std.h
  78.  
  79. .PHONY: install
  80. install: $(PROGRAM).exe
  81.     $(INSTALL) $(PROGRAM).exe $(BINDIR)
  82.  
  83. .PHONY: docs
  84. docs: $(PROGRAM).inf $(PROGRAM).dvi
  85.  
  86. $(PROGRAM).inf: $(PROGRAM).tex
  87.     makeinfo $<
  88.  
  89. $(PROGRAM).dvi: $(PROGRAM).tex
  90.     tex $(PROGRAM)
  91.     tex $(PROGRAM)
  92.     rm $(PROGRAM).??
  93.  
  94. tags: $(SRCS)
  95.     etags $^
  96.  
  97. .PHONY: clean
  98. clean:
  99.     rm -f *.exe *.obj *.aux *.toc *.log *.dvi *.dlg *.inf errs tags
  100.     rm -r $(PROGRAM)
  101.     rcsclean *.c *.h *.tex makefile
  102.  
  103. .PHONY: zip disk
  104. zip: $(ZIPFILE)
  105. disk: $(DISK)/$(ZIPFILE)
  106.  
  107. $(ZIPFILE): $(RCSFILES) $(MISC)
  108.     pkzip -frp $@
  109.  
  110. $(DISK)/$(ZIPFILE): $(ZIPFILE)
  111.     cp $< $@
  112.     pkunzip -t $@ | grep -vw OK
  113.  
  114. .PHONY: dist tar-dist zip-dist
  115. dist: tar-dist zip-dist
  116.  
  117. tar-dist: $(PROGRAM)-tar.uue
  118. zip-dist: $(PROGRAM)-zip.uue
  119.  
  120. $(PROGRAM)-tar.uue: $(addprefix $(PROGRAM)/,$(DIST_FILES))
  121.     flip -ub $(PROGRAM)/*.*
  122.     tar -cf - $(PROGRAM) | compress | uuencode $(PROGRAM).tar.Z > $@
  123.  
  124. $(PROGRAM)-zip.uue:  $(addprefix $(PROGRAM)/,$(DIST_FILES))
  125.     flip -mb $(PROGRAM)/*.*
  126.     echo GNU $(PROGRAM) (pre-alpha) for MS-DOS \
  127.         | pkzip -z $(PROGRAM)dist $(PROGRAM)/*.*
  128.     uuencode $(PROGRAM)dist.zip $(PROGRAM).zip > $@
  129.  
  130. $(PROGRAM)/%: %
  131.     cp $< $@
  132.  
  133. $(addprefix $(PROGRAM)/,$(DIST_FILES)): $(PROGRAM)
  134.  
  135. $(PROGRAM):
  136.     mkdir $(PROGRAM)
  137.