home *** CD-ROM | disk | FTP | other *** search
Makefile | 1996-02-24 | 3.6 KB | 157 lines |
- # $Header: /home/amb/cxref/RCS/Makefile 1.17 1996/02/24 14:49:14 amb Exp $
- #
- # C Cross Referencing & Documentation tool. Version 1.0.
- #
- # Program Makefile.
- #
- # Written by Andrew M. Bishop
- #
- # This file Copyright 1995,96 Andrew M. Bishop
- # It may be distributed under the GNU Public License, version 2, or
- # any higher version. See section COPYING of the GNU Public license
- # for conditions under which this file may be redistributed.
- #
-
- CC=gcc
- CFLAGS=-O2
-
- INCLUDES=
-
- LIB=
-
- COMPILE=$(CC) -c $(CFLAGS)
-
- LINK=$(CC)
-
- YACC=bison -y -l
-
- LEX=flex
-
- LATEX=latex
-
- # For the default cpp (gcc -E -C -dD)
- #CPP_TO_USE=
-
- # For the modified cpp
- CPP_TO_USE=/home/amb/cxref/cpp/cxref-cpp -C -dD
-
- ########
-
- program : cxref cxref-cpp cxref-query
- @
-
- docs : readme
- make -C doc
-
- all : program docs
- @
-
- ####
-
- OBJ_FILES=cxref.o \
- func.o type.o var.o preproc.o comment.o file.o \
- slist.o memory.o \
- xref.o \
- warn-raw.o latex.o latex-style.o \
- html.o \
- parse-lex.o parse-yacc.o
-
- cxref : $(OBJ_FILES)
- $(LINK) $(OBJ_FILES) -o $@ $(LIB)
-
- ####
-
- cxref-cpp :
- ifeq ($(CPP_TO_USE),)
- @
- else
- make -C cpp cxref-cpp
- endif
-
- ####
-
- cxref-query :
- make -C query cxref-query
-
- ####
-
- readme : cxref cxref-cpp README.c
- cxref -Odoc -NREADME -html -latex README.c
- cp doc/README.c.html README.c.html
- cp doc/README.c.tex README_c.tex
- $(LATEX) README.tex
- $(LATEX) README.tex
- @rm README.toc README.aux README.log doc/README.*
-
- ########
-
- parse-yacc.c : parse.y
- $(YACC) -d $<
- -@mv y.tab.c parse-yacc.c
- @echo Created parse-yacc.c
-
- parse-yacc.h : parse-yacc.c
- -@if ( cmp -s parse-yacc.h y.tab.h ) ; then : ; else \
- cp y.tab.h parse-yacc.h ; \
- echo Created parse-yacc.h ; \
- fi
-
- ########
-
- parse-lex.c : parse.l
- $(LEX) $<
- -@mv lex.yy.c parse-lex.c
- @echo Created parse-lex.c
-
- ########
-
- latex-style.c : doc/page.sty doc/fonts.sty
- @echo '/** The style files needed for LaTeX. **/' > latex-style.c
- @echo '/*+ The page style file as a string. +*/' >> latex-style.c
- @echo 'char *latex_page_style="' >> latex-style.c
- @sed -e 's/\\/\\\\/g' -e 's/%/%%/g' doc/page.sty >> latex-style.c
- @echo '";' >> latex-style.c
- @echo '/*+ The fonts style file as a string. +*/' >> latex-style.c
- @echo 'char *latex_fonts_style="' >> latex-style.c
- @sed -e 's/\\/\\\\/g' -e 's/%/%%/g' doc/fonts.sty >> latex-style.c
- @echo '";' >> latex-style.c
- @echo Created latex-style.c
-
- ########
-
- %.o:%.c
- $(COMPILE) $< -o $@ $(INCLUDES)
-
- cxref.o : cxref.c cxref.h datatype.h memory.h parse-yy.h
- ifeq ($(CPP_TO_USE),)
- $(COMPILE) $< -o $@ $(INCLUDES)
- else
- $(COMPILE) $< -o $@ '-DCXREF_CPP="$(CPP_TO_USE)"' $(INCLUDES)
- endif
-
- func.o : func.c cxref.h datatype.h memory.h
- type.o : type.c cxref.h datatype.h memory.h
- var.o : var.c cxref.h datatype.h memory.h
- comment.o : comment.c cxref.h datatype.h memory.h
- file.o : file.c cxref.h datatype.h memory.h
- preproc.o : preproc.c cxref.h datatype.h memory.h
-
- slist.o : slist.c cxref.h datatype.h memory.h
- memory.o : memory.c memory.h
-
- xref.o : xref.c cxref.h datatype.h memory.h
- warn-raw.o : warn-raw.c cxref.h datatype.h memory.h
- latex.o : latex.c cxref.h datatype.h memory.h
- latex-style.o : latex-style.c
- html.o : html.c cxref.h datatype.h memory.h
-
- parse-yacc.o : parse-yacc.c cxref.h parse-yacc.h memory.h parse-yy.h
- parse-lex.o : parse-lex.c cxref.h parse-yacc.h memory.h parse-yy.h
-
- ########
-
- clean :
- -rm -f core *.o *~ parse-lex.* parse-yacc.* lex.*.c y.tab.* latex-style.c
-
- ########
-