home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / cz / part09 / uMakefile < prev   
Makefile  |  1989-10-01  |  2KB  |  84 lines

  1. # uMakefile - micro GNU make file for cz
  2. #
  3. # $Header: uMakefile,v 1.6 89/09/22 07:44:45 howard Exp $
  4. #
  5. # Copyright 1989 Howard Lee Gayle
  6. # This file is written in the ISO 8859/1 character set.
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License version 1,
  10. # as published by the Free Software Foundation.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21.  
  22. include MakeCommon
  23.  
  24. # Commands:
  25.  
  26. # Make depend file that shows include files that C programs use.
  27. DEPEND=mkCIncl
  28.  
  29. # Search for regual expression.
  30. GREP=grep
  31.  
  32. # Make FREEZE.*.
  33. MKFREEZE=mkFreeze
  34.  
  35. # Sort file.
  36. SORT=sort
  37.  
  38. # Sources:
  39. CS := $(filter %.c,$(SRCS))
  40. HS := $(filter %.h,$(SRCS))
  41.  
  42. # Targets:
  43. it = FREEZE.i ps-abbrev.i state0.i
  44.  
  45. targets := $(it) Makefile depend
  46.  
  47. ifdef WORK
  48. .DEFAULT:
  49.     $(UNCMPRS) $@
  50. else # WORK
  51. .DEFAULT:
  52.     $(DISTI) $@ $(DD)
  53. endif # WORK
  54.  
  55. .SUFFIXES:
  56. .PHONY: default
  57.  
  58. default: $(targets)
  59.  
  60. ifndef WORK
  61. Makefile: $(DD)/Makefile
  62.     $(DISTI) $@ $(DD)
  63. endif # WORK
  64.  
  65. depend: $(CS) $(HS) $(it)
  66.     $(DEPEND) "$(INCLUDES)" $(CS) > $@
  67.  
  68. FREEZE.i: FREEZE
  69.     $(RM) FREEZE.*
  70.     $(MKFREEZE)
  71.     $(CHMOD) a=r FREEZE.*
  72.  
  73. #The following slick sed script takes the M4-format defines in ps-abbrev.m4
  74. #and turns them into C format #defines suitable for including into cz0.c.
  75. ps-abbrev.i: ps-abbrev.m4
  76.     $(GREP) '^define(' $< | \
  77.         $(SED) -e \
  78.         's;^define(\([^,]*\),\(  *\)\([^)]*\))dnl\(..*\);#define \1\2 S("\3") /*\4*/;' \
  79.         | $(SORT) > $@
  80.  
  81. state0.i: ps-abbrev.m4 state0.m4
  82.     $(M4) state0.m4 > $@
  83.  
  84.