home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cxref15a.zip / EMX / gnu / cxref-1.5 / Makefile.in < prev    next >
Makefile  |  1999-01-28  |  7KB  |  238 lines

  1. # $Header: /home/amb/cxref/RCS/Makefile.in 1.5 1999/01/28 19:23:01 amb Exp $
  2. #
  3. # C Cross Referencing & Documentation tool. Version 1.5.
  4. #
  5. # Program Makefile.
  6. #
  7. # Written by Andrew M. Bishop
  8. #
  9. # This file Copyright 1995,96,97,98,99 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. # autoconf things
  16.  
  17. srcdir=@srcdir@
  18. VPATH=@srcdir@
  19.  
  20. # The installation locations
  21.  
  22. prefix=@prefix@
  23. exec_prefix=@exec_prefix@
  24. bindir=@bindir@
  25. mandir=@mandir@
  26.  
  27. # The installation program.
  28.  
  29. INSTALL=@INSTALL@
  30.  
  31. # The C compiler and linker
  32.  
  33. CC=@CC@
  34. LD=@CC@
  35.  
  36. # The Yacc program
  37.  
  38. YACC=@YACC@ -l
  39.  
  40. # The Lex Program
  41.  
  42. LEX=@LEX@ -L
  43.  
  44. # The Perl program
  45.  
  46. PERL=@PERL@
  47.  
  48. # The LaTeX and dvips programs
  49.  
  50. LATEX=@LATEX@
  51. DVIPS=@DVIPS@
  52.  
  53. # The page size (for LaTeX and RTF).
  54. # (A4 or US only.)
  55.  
  56. PAGE=@PAGE@
  57.  
  58. ########
  59.  
  60. INCLUDE=
  61. LIBRARY=@LIBS@
  62.  
  63. ########
  64.  
  65. programs : cxref-cpp cxref cxref-inst cxref-query
  66.  
  67. docs : readme faq-html
  68.     cd doc && $(MAKE)
  69.  
  70. all : programs docs
  71.  
  72. ########
  73.  
  74. OBJ_FILES=func.o type.o var.o preproc.o comment.o file.o \
  75.           slist.o memory.o \
  76.           xref.o \
  77.           warn-raw.o latex.o latex-style.o html.o rtf.o sgml.o \
  78.           parse-lex.o parse-yacc.o
  79.  
  80. cxref : cxref.o $(OBJ_FILES)
  81.     $(LD) $(LDFLAGS) cxref.o $(OBJ_FILES) -o $@ $(LIBRARY)
  82.  
  83. cxref-inst : cxref-inst.o $(OBJ_FILES)
  84.     $(LD) $(LDFLAGS) cxref-inst.o $(OBJ_FILES) -o $@ $(LIBRARY)
  85.  
  86. ####
  87.  
  88. cxref-cpp :
  89.     cd cpp && $(MAKE) programs
  90.  
  91. ####
  92.  
  93. cxref-query :
  94.     cd query && $(MAKE) programs
  95.  
  96. ########
  97.  
  98. faq-html : FAQ FAQ-html.pl
  99.     [ "x$(PERL)" = "x" ] || $(PERL) FAQ-html.pl < FAQ > FAQ.html
  100.  
  101. ####
  102.  
  103. readme : programs README.c
  104.     ./cxref -Odoc -NREADME -xref README.c
  105.     ./cxref -Odoc -NREADME -xref README.c -latex2e -html32-src -rtf -sgml
  106.     cp doc/README.c.tex      README_c.tex
  107.     cp doc/README.c.html     README.c.html
  108.     cp doc/README.c.src.html README.c.src.html
  109.     cp doc/README.c.rtf      README.c.rtf
  110.     cp doc/README.c.sgml     README.c.sgml
  111.     [ "x$(LATEX)" = "x" ] || $(LATEX) README.tex > /dev/null 2>&1
  112.     [ "x$(LATEX)" = "x" ] || $(LATEX) README.tex
  113.     [ "x$(DVIPS)" = "x" ] || $(DVIPS) README.dvi -o README.ps
  114.     @rm -f README.aux README.log README.toc doc/README.*
  115.  
  116. ########
  117.  
  118. install : programs
  119.     [ -d $(bindir) ] || $(INSTALL) -d $(bindir)
  120.     $(INSTALL) -m 755 cxref-inst $(bindir)/cxref
  121.     $(INSTALL) -m 755 cxref-cc $(bindir)
  122.     [ -d $(mandir)/man1 ] || $(INSTALL) -d $(mandir)/man1
  123.     $(INSTALL) -m 644 README.man $(mandir)/man1/cxref.1
  124.     cd cpp && $(MAKE) install
  125.     cd query && $(MAKE) install
  126.  
  127. install-win32 : programs
  128.     [ -d $(bindir) ] || $(INSTALL) -d $(bindir)
  129.     $(INSTALL) -m 755 cxref-inst.exe $(bindir)/cxref.exe
  130.     $(INSTALL) -m 755 cxref-cc $(bindir)
  131.     cd cpp && $(MAKE) install-win32
  132.     cd query && $(MAKE) install-win32
  133.  
  134. ########
  135.  
  136. clean :
  137.     -rm -f cxref core *.o *~ \
  138.     lex.*.c y.tab.* latex-style.c \
  139.     README.dvi README.ps
  140.     cd cpp && $(MAKE) clean
  141.     cd doc && $(MAKE) clean
  142.     cd query && $(MAKE) clean
  143.  
  144. ####
  145.  
  146. distclean : clean
  147.     -rm -f Makefile autoconfig.h \
  148.     config.log config.status config.cache
  149.     cd cpp && $(MAKE) distclean
  150.     cd doc && $(MAKE) distclean
  151.     cd query && $(MAKE) distclean
  152.  
  153. ########
  154.  
  155. parse-yacc.c : parse.y
  156.     $(YACC) -d parse.y
  157.     -@mv y.tab.c  parse-yacc.c
  158.     @echo Created parse-yacc.c
  159.  
  160. parse-yacc.h : parse-yacc.c
  161.     -@if cmp -s parse-yacc.h y.tab.h ; then : ; else \
  162.        if [ -f y.tab.h ] ; then \
  163.           cp y.tab.h parse-yacc.h ; \
  164.           echo Created parse-yacc.h ; \
  165.        fi \
  166.     fi
  167.  
  168. ####
  169.  
  170. parse-lex.c : parse.l
  171.     $(LEX) parse.l
  172.     -@mv lex.yy.c parse-lex.c
  173.     @echo Created parse-lex.c
  174.  
  175. ####
  176.  
  177. latex-style.c : doc/fonts.style doc/page.style doc/cxref.style
  178.     @echo '/** The style files needed for LaTeX. **/' >  latex-style.c
  179.     @echo ''                                          >> latex-style.c
  180.     @echo '/*+ The fonts style file as a string. +*/' >> latex-style.c
  181.     @echo 'char *latex_fonts_style='                  >> latex-style.c
  182.     @sed 's/\\/\\\\/g' doc/fonts.style \
  183.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  184.     @echo ';'                                         >> latex-style.c
  185.     @echo ''                                          >> latex-style.c
  186.     @echo '/*+ The page style file as a string. +*/'  >> latex-style.c
  187.     @echo 'char *latex_page_style='                   >> latex-style.c
  188.     @sed 's/    CONFIG-ONLY PAGE=$(PAGE)//g' doc/page.style \
  189.     |grep -v 'CONFIG-ONLY' \
  190.     |sed 's/\\/\\\\/g' \
  191.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  192.     @echo ';'                                         >> latex-style.c
  193.     @echo ''                                          >> latex-style.c
  194.     @echo '/*+ The cxref style file as a string. +*/' >> latex-style.c
  195.     @echo 'char *latex_cxref_style='                  >> latex-style.c
  196.     @sed 's/\\/\\\\/g' doc/cxref.style \
  197.     |awk '{print "\"" $$0 "\\n\""}'                   >> latex-style.c
  198.     @echo ';'                                         >> latex-style.c
  199.     @echo Created latex-style.c
  200.  
  201. ####
  202.  
  203. %.o:%.c
  204.     $(CC) -c $(CFLAGS) $< -o $@ $(INCLUDE)
  205.  
  206. cxref.o      : cxref.c      cxref.h datatype.h memory.h parse-yy.h
  207.     [ ! -f cpp/cxref-cpp ] || $(CC) -c $(CFLAGS) cxref.c -o $@ $(INCLUDE) "-DCXREF_CPP=\"$$PWD/cpp/cxref-cpp -C -dD -dI\""
  208.     [   -f cpp/cxref-cpp ] || $(CC) -c $(CFLAGS) cxref.c -o $@ $(INCLUDE) "-DCXREF_CPP=\"$(CC) -E -C -dD -dI\""
  209.  
  210. cxref-inst.o : cxref.c      cxref.h datatype.h memory.h parse-yy.h
  211.     [ ! -f cpp/cxref-cpp ] || $(CC) -c $(CFLAGS) cxref.c -o $@ $(INCLUDE) '-DCXREF_CPP="cxref-cpp -C -dD -dI"'
  212.     [   -f cpp/cxref-cpp ] || $(CC) -c $(CFLAGS) cxref.c -o $@ $(INCLUDE) "-DCXREF_CPP=\"$(CC) -E -C -dD -dI\""
  213.  
  214. func.o       : func.c       cxref.h datatype.h memory.h parse-yy.h
  215. type.o       : type.c       cxref.h datatype.h memory.h parse-yy.h
  216. var.o        : var.c        cxref.h datatype.h memory.h parse-yy.h
  217. comment.o    : comment.c    cxref.h datatype.h memory.h
  218. file.o       : file.c       cxref.h datatype.h memory.h
  219. preproc.o    : preproc.c    cxref.h datatype.h memory.h parse-yy.h
  220.  
  221. slist.o      : slist.c      cxref.h datatype.h memory.h
  222. memory.o     : memory.c                        memory.h
  223.  
  224. xref.o       : xref.c       cxref.h datatype.h memory.h
  225.  
  226. warn-raw.o   : warn-raw.c   cxref.h datatype.h memory.h
  227. latex.o      : latex.c      cxref.h datatype.h memory.h
  228. latex-style.o: latex-style.c
  229. html.o       : html.c       cxref.h datatype.h memory.h
  230. rtf.o        : rtf.c        cxref.h datatype.h memory.h
  231.     $(CC) -c $(CFLAGS) rtf.c -o $@ -DPAGE=\"$(PAGE)\" $(INCLUDE)
  232. sgml.o       : sgml.c       cxref.h datatype.h memory.h
  233.  
  234. parse-yacc.o : parse-yacc.c cxref.h datatype.h memory.h parse-yy.h parse-yacc.h
  235. parse-lex.o  : parse-lex.c  cxref.h datatype.h memory.h parse-yy.h parse-yacc.h
  236.  
  237. ########
  238.