# # C Cross Referencing & Documentation tool. Version 1.6d. # # Program Makefile. # # Written by Andrew M. Bishop # # This file Copyright 1995-2012 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. # # autoconf things srcdir=@srcdir@ VPATH=@srcdir@ # The installation locations prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=$(DESTDIR)@bindir@ # The installation program. INSTALL=@INSTALL@ # The C compiler and linker CC=@CC@ LD=@CC@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ LDFLAGS=@LDFLAGS@ # The Yacc program YACC=@YACC@ YACCFLAGS=-d BISONFLAGS=-d # The Lex Program LEX=@LEX@ LEXFLAGS= FLEXFLAGS=-p -B -F -8 -s # The page size (for LaTeX and RTF). # (A4 or US only.) PAGE=@PAGE@ ######## INCLUDE=-I. -I$(srcdir) LIBRARY=@LIBS@ ######## programs : cxref cxref-inst all : programs ######## install : programs [ -d $(bindir) ] || $(INSTALL) -d $(bindir) $(INSTALL) -m 755 cxref-inst $(bindir)/cxref $(INSTALL) -m 755 $(srcdir)/cxref-cc $(bindir) install-win32 : programs [ -d $(bindir) ] || $(INSTALL) -d $(bindir) $(INSTALL) -m 755 cxref-inst.exe $(bindir)/cxref.exe $(INSTALL) -m 755 cxref-cc $(bindir) ######## clean : -rm -f cxref cxref-inst core *.o *~ \ lex.*.c y.tab.* latex-style.c html-style.c \ parse-yacc.c parse-yacc.h parse-lex.c #### distclean : clean -rm -f Makefile autoconfig.h ######## OBJ_FILES=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 html-style.o rtf.o sgml.o \ parse-lex.o parse-yacc.o cxref : cxref.o $(OBJ_FILES) $(LD) $(LDFLAGS) cxref.o $(OBJ_FILES) -o $@ $(LIBRARY) cxref-inst : cxref-inst.o $(OBJ_FILES) $(LD) $(LDFLAGS) cxref-inst.o $(OBJ_FILES) -o $@ $(LIBRARY) ######## parse-yacc.c parse-yacc.h : parse.y [ ! "$(YACC)" = "bison" ] || $(YACC) $(BISONFLAGS) $(srcdir)/parse.y [ "$(YACC)" = "bison" ] || $(YACC) $(YACCFLAGS) $(srcdir)/parse.y -@if cmp -s parse-yacc.c y.tab.c ; then \ rm y.tab.c ; \ else \ mv y.tab.c parse-yacc.c ; \ echo Created parse-yacc.c ; \ fi -@if cmp -s parse-yacc.h y.tab.h ; then \ rm y.tab.h ; \ else \ mv y.tab.h parse-yacc.h ; \ echo Created parse-yacc.h ; \ fi #### parse-lex.c : parse.l [ ! "$(LEX)" = "flex" ] || $(LEX) $(FLEXFLAGS) $(srcdir)/parse.l [ "$(LEX)" = "flex" ] || $(LEX) $(LEXFLAGS) $(srcdir)/parse.l -@mv lex.yy.c parse-lex.c @echo Created parse-lex.c #### latex-style.c : $(srcdir)/fonts.sty.in $(srcdir)/page.sty.in $(srcdir)/cxref.sty.in @echo '/** The style files needed for LaTeX. **/' > 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' $(srcdir)/fonts.sty.in \ |awk '{print "\"" $$0 "\\n\""}' >> latex-style.c @echo ';' >> latex-style.c @echo '' >> 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' $(srcdir)/page.sty.in \ |sed 's/ CONFIG-ONLY PAGE=$(PAGE)//g' \ |grep -v 'CONFIG-ONLY' \ |awk '{print "\"" $$0 "\\n\""}' >> latex-style.c @echo ';' >> latex-style.c @echo '' >> latex-style.c @echo '/*+ The cxref style file as a string. +*/' >> latex-style.c @echo 'char *latex_cxref_style=' >> latex-style.c @sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' $(srcdir)/cxref.sty.in \ |awk '{print "\"" $$0 "\\n\""}' >> latex-style.c @echo ';' >> latex-style.c @echo Created latex-style.c #### html-style.c : $(srcdir)/cxref.css.in @echo '/** The Cascading Style Sheet for HTML. **/' > html-style.c @echo '' >> html-style.c @echo '/*+ The cxref CSS file as a string. +*/' >> html-style.c @echo 'char *html_cxref_style=' >> html-style.c @sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' $(srcdir)/cxref.css.in \ |awk '{print "\"" $$0 "\\n\""}' >> html-style.c @echo ';' >> html-style.c @echo Created html-style.c #### cpp_dir=@abs_top_builddir@/cpp .SUFFIXES: .SUFFIXES: .c .o .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ $(INCLUDE) cxref.o : cxref.c cxref.h datatype.h memory.h parse-yy.h version.h [ ! -f ../cpp/cxref-cpp ] || $(CC) -c $(CPPFLAGS) $(CFLAGS) cxref.c -o $@ $(INCLUDE) "-DCXREF_CPP=\"$(cpp_dir)/cxref-cpp -cxref-cpp-defines $(cpp_dir)/cxref-cpp.defines -lang-c -C -dD -dI\"" [ -f ../cpp/cxref-cpp ] || $(CC) -c $(CPPFLAGS) $(CFLAGS) cxref.c -o $@ $(INCLUDE) cxref-inst.o : cxref.c cxref.h datatype.h memory.h parse-yy.h [ ! -f ../cpp/cxref-cpp ] || $(CC) -c $(CPPFLAGS) $(CFLAGS) cxref.c -o $@ $(INCLUDE) '-DCXREF_CPP="cxref-cpp -lang-c -C -dD -dI"' [ -f ../cpp/cxref-cpp ] || $(CC) -c $(CPPFLAGS) $(CFLAGS) cxref.c -o $@ $(INCLUDE) func.o : func.c cxref.h datatype.h memory.h parse-yy.h type.o : type.c cxref.h datatype.h memory.h parse-yy.h var.o : var.c cxref.h datatype.h memory.h parse-yy.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 parse-yy.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 version.h latex-style.o: latex-style.c html.o : html.c cxref.h datatype.h memory.h version.h html-style.o : html-style.c rtf.o : rtf.c cxref.h datatype.h memory.h version.h $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ -DPAGE=\"$(PAGE)\" $(INCLUDE) sgml.o : sgml.c cxref.h datatype.h memory.h version.h parse-yacc.o : parse-yacc.c cxref.h datatype.h memory.h parse-yy.h parse-yacc.h parse-lex.o : parse-lex.c cxref.h datatype.h memory.h parse-yy.h parse-yacc.h ########