home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / cxref-1.001 / cxref-1~ / cxref / Makefile < prev    next >
Encoding:
Makefile  |  1996-02-24  |  3.6 KB  |  157 lines

  1. # $Header: /home/amb/cxref/RCS/Makefile 1.17 1996/02/24 14:49:14 amb Exp $
  2. #
  3. # C Cross Referencing & Documentation tool. Version 1.0.
  4. #
  5. # Program Makefile.
  6. #
  7. # Written by Andrew M. Bishop
  8. #
  9. # This file Copyright 1995,96 Andrew M. Bishop
  10. # It may be distributed under the GNU Public License, version 2, or
  11. # any higher version.  See section COPYING of the GNU Public license
  12. # for conditions under which this file may be redistributed.
  13. #
  14.  
  15. CC=gcc
  16. CFLAGS=-O2
  17.  
  18. INCLUDES=
  19.  
  20. LIB=
  21.  
  22. COMPILE=$(CC) -c $(CFLAGS)
  23.  
  24. LINK=$(CC) 
  25.  
  26. YACC=bison -y -l
  27.  
  28. LEX=flex
  29.  
  30. LATEX=latex
  31.  
  32. # For the default cpp (gcc -E -C -dD)
  33. #CPP_TO_USE=
  34.  
  35. # For the modified cpp
  36. CPP_TO_USE=/home/amb/cxref/cpp/cxref-cpp -C -dD
  37.  
  38. ########
  39.  
  40. program : cxref cxref-cpp cxref-query
  41.     @
  42.  
  43. docs : readme
  44.     make -C doc
  45.  
  46. all : program docs
  47.     @
  48.  
  49. ####
  50.  
  51. OBJ_FILES=cxref.o \
  52.           func.o type.o var.o preproc.o comment.o file.o \
  53.           slist.o memory.o \
  54.           xref.o \
  55.           warn-raw.o latex.o latex-style.o \
  56.           html.o \
  57.           parse-lex.o parse-yacc.o
  58.  
  59. cxref : $(OBJ_FILES)
  60.     $(LINK) $(OBJ_FILES) -o $@ $(LIB)
  61.  
  62. ####
  63.  
  64. cxref-cpp :
  65. ifeq ($(CPP_TO_USE),)
  66.     @
  67. else
  68.     make -C cpp cxref-cpp
  69. endif
  70.  
  71. ####
  72.  
  73. cxref-query :
  74.     make -C query cxref-query
  75.  
  76. ####
  77.  
  78. readme : cxref cxref-cpp README.c
  79.     cxref -Odoc -NREADME -html -latex README.c
  80.     cp doc/README.c.html README.c.html
  81.     cp doc/README.c.tex  README_c.tex
  82.     $(LATEX) README.tex
  83.     $(LATEX) README.tex
  84.     @rm README.toc README.aux README.log doc/README.*
  85.  
  86. ########
  87.  
  88. parse-yacc.c : parse.y
  89.     $(YACC) -d $<
  90.     -@mv y.tab.c  parse-yacc.c
  91.     @echo Created parse-yacc.c
  92.  
  93. parse-yacc.h : parse-yacc.c
  94.     -@if ( cmp -s parse-yacc.h y.tab.h ) ; then : ; else \
  95.            cp y.tab.h parse-yacc.h ; \
  96.        echo Created parse-yacc.h ; \
  97.         fi
  98.  
  99. ########
  100.  
  101. parse-lex.c : parse.l
  102.     $(LEX) $<
  103.     -@mv lex.yy.c parse-lex.c
  104.     @echo Created parse-lex.c
  105.  
  106. ########
  107.  
  108. latex-style.c : doc/page.sty doc/fonts.sty
  109.     @echo '/** The style files needed for LaTeX. **/' >  latex-style.c
  110.     @echo '/*+ The page style file as a string. +*/'  >> latex-style.c
  111.     @echo 'char *latex_page_style="'                  >> latex-style.c
  112.     @sed -e 's/\\/\\\\/g' -e 's/%/%%/g' doc/page.sty  >> latex-style.c
  113.     @echo '";'                                        >> latex-style.c
  114.     @echo '/*+ The fonts style file as a string. +*/' >> latex-style.c
  115.     @echo 'char *latex_fonts_style="'                 >> latex-style.c
  116.     @sed -e 's/\\/\\\\/g' -e 's/%/%%/g' doc/fonts.sty >> latex-style.c
  117.     @echo '";'                                        >> latex-style.c
  118.     @echo Created latex-style.c
  119.  
  120. ########
  121.  
  122. %.o:%.c
  123.     $(COMPILE) $< -o $@ $(INCLUDES)
  124.  
  125. cxref.o      : cxref.c      cxref.h datatype.h   memory.h parse-yy.h
  126. ifeq ($(CPP_TO_USE),)
  127.     $(COMPILE) $< -o $@ $(INCLUDES)
  128. else
  129.     $(COMPILE) $< -o $@ '-DCXREF_CPP="$(CPP_TO_USE)"' $(INCLUDES)
  130. endif
  131.  
  132. func.o       : func.c       cxref.h datatype.h   memory.h
  133. type.o       : type.c       cxref.h datatype.h   memory.h
  134. var.o        : var.c        cxref.h datatype.h   memory.h
  135. comment.o    : comment.c    cxref.h datatype.h   memory.h
  136. file.o       : file.c       cxref.h datatype.h   memory.h
  137. preproc.o    : preproc.c    cxref.h datatype.h   memory.h
  138.  
  139. slist.o      : slist.c      cxref.h datatype.h   memory.h
  140. memory.o     : memory.c                          memory.h
  141.  
  142. xref.o       : xref.c       cxref.h datatype.h   memory.h
  143. warn-raw.o   : warn-raw.c   cxref.h datatype.h   memory.h
  144. latex.o      : latex.c      cxref.h datatype.h   memory.h
  145. latex-style.o : latex-style.c
  146. html.o       : html.c       cxref.h datatype.h   memory.h
  147.  
  148. parse-yacc.o : parse-yacc.c cxref.h parse-yacc.h memory.h parse-yy.h
  149. parse-lex.o  : parse-lex.c  cxref.h parse-yacc.h memory.h parse-yy.h
  150.  
  151. ########
  152.  
  153. clean :
  154.     -rm -f core *.o *~ parse-lex.* parse-yacc.* lex.*.c y.tab.* latex-style.c
  155.  
  156. ########
  157.