3 # C Cross Referencing & Documentation tool. Version 1.5g.
7 # Written by Andrew M. Bishop
9 # This file Copyright 1995,96,97,98,99,2000,01,02,03,04 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.
21 # The installation locations
24 exec_prefix=@
exec_prefix@
25 bindir=$(DESTDIR
)@
bindir@
26 mandir=$(DESTDIR
)@
mandir@
28 # The installation program.
32 # The C compiler and linker
52 FLEXFLAGS
=-p
-B
-F
-8 -s
58 # The LaTeX and dvips programs
63 # The page size (for LaTeX and RTF).
75 programs
: cxref-cpp cxref cxref-inst cxref-query
77 docs
: readme faq-html
84 OBJ_FILES
=func.o type.o var.o preproc.o comment.o file.o \
87 warn-raw.o latex.o latex-style.o html.o rtf.o sgml.o \
88 parse-lex.o parse-yacc.o
90 cxref
: cxref.o
$(OBJ_FILES
)
91 $(LD
) $(LDFLAGS
) cxref.o
$(OBJ_FILES
) -o
$@
$(LIBRARY
)
93 cxref-inst
: cxref-inst.o
$(OBJ_FILES
)
94 $(LD
) $(LDFLAGS
) cxref-inst.o
$(OBJ_FILES
) -o
$@
$(LIBRARY
)
99 cd
cpp && $(MAKE
) programs
104 cd query
&& $(MAKE
) programs
108 faq-html
: FAQ FAQ-html.pl
109 [ "x$(PERL)" = "x" ] ||
$(PERL
) $(srcdir)/FAQ-html.pl
< $(srcdir)/FAQ
> FAQ.html
113 readme
: programs README.c
114 cd
$(srcdir) && $(objdir
)/cxref
-O
$(objdir
)/doc
-NREADME
-xref README.c
115 cd
$(srcdir) && $(objdir
)/cxref
-O
$(objdir
)/doc
-NREADME
-xref README.c
-latex2e
-html32-src
-rtf
-sgml
116 cp doc
/README.c.
tex README_c.
tex
117 cp doc
/README.c.html README.c.html
118 cp doc
/README.c.src.html README.c.src.html
119 cp doc
/README.c.rtf README.c.rtf
120 cp doc
/README.c.sgml README.c.sgml
121 [ "x$(LATEX)" = "x" ] ||
$(LATEX
) README.
tex > /dev
/null
2>&1
122 [ "x$(LATEX)" = "x" ] ||
$(LATEX
) README.
tex
123 [ "x$(DVIPS)" = "x" ] ||
$(DVIPS
) README.
dvi -o README.ps
124 @
rm -f README.aux README.log README.toc doc
/README.
*
129 [ -d
$(bindir) ] ||
$(INSTALL
) -d
$(bindir)
130 $(INSTALL
) -m
755 cxref-inst
$(bindir)/cxref
131 $(INSTALL
) -m
755 $(srcdir)/cxref-cc
$(bindir)
132 [ -d
$(mandir)/man1
] ||
$(INSTALL
) -d
$(mandir)/man1
133 $(INSTALL
) -m
644 $(srcdir)/README.man
$(mandir)/man1
/cxref
.1
134 cd
cpp && $(MAKE
) install
135 cd query
&& $(MAKE
) install
137 install-win32
: programs
138 [ -d
$(bindir) ] ||
$(INSTALL
) -d
$(bindir)
139 $(INSTALL
) -m
755 cxref-inst.exe
$(bindir)/cxref.exe
140 $(INSTALL
) -m
755 cxref-cc
$(bindir)
141 cd
cpp && $(MAKE
) install-win32
142 cd query
&& $(MAKE
) install-win32
147 -rm -f cxref cxref-inst core
*.o
*~ \
148 lex.
*.c y.tab.
* latex-style.c \
149 parse-yacc.c parse-yacc.h parse-lex.c \
151 cd
cpp && $(MAKE
) clean
152 cd doc
&& $(MAKE
) clean
153 cd query
&& $(MAKE
) clean
158 -rm -f Makefile autoconfig.h \
159 config.log config.status config.cache
160 cd
cpp && $(MAKE
) distclean
161 cd doc
&& $(MAKE
) distclean
162 cd query
&& $(MAKE
) distclean
166 parse-yacc.c
: parse.y
167 [ ! "$(YACC)" = "bison" ] ||
$(YACC
) $(BISONFLAGS
) $(srcdir)/parse.y
168 [ "$(YACC)" = "bison" ] ||
$(YACC
) $(YACCFLAGS
) $(srcdir)/parse.y
169 -@mv y.tab.c parse-yacc.c
170 @echo Created parse-yacc.c
172 parse-yacc.h
: parse-yacc.c
173 -@if cmp
-s parse-yacc.h y.tab.h
; then \
176 if
[ -f y.tab.h
] ; then \
177 cp y.tab.h parse-yacc.h
; \
178 echo Created parse-yacc.h
; \
184 parse-lex.c
: parse.l
185 [ ! "$(LEX)" = "flex" ] ||
$(LEX
) $(FLEXFLAGS
) $(srcdir)/parse.l
186 [ "$(LEX)" = "flex" ] ||
$(LEX
) $(LEXFLAGS
) $(srcdir)/parse.l
187 -@mv
lex.yy.c parse-lex.c
188 @echo Created parse-lex.c
192 latex-style.c
: $(srcdir)/doc
/fonts.style
$(srcdir)/doc
/page.style
$(srcdir)/doc
/cxref.style
193 @echo
'/** The style files needed for LaTeX. **/' > latex-style.c
194 @echo
'' >> latex-style.c
195 @echo
'/*+ The fonts style file as a string. +*/' >> latex-style.c
196 @echo
'char *latex_fonts_style=' >> latex-style.c
197 @sed
's/\\/\\\\/g' $(srcdir)/doc
/fonts.style \
198 |awk
'{print "\"" $$0 "\\n\""}' >> latex-style.c
199 @echo
';' >> latex-style.c
200 @echo
'' >> latex-style.c
201 @echo
'/*+ The page style file as a string. +*/' >> latex-style.c
202 @echo
'char *latex_page_style=' >> latex-style.c
203 @sed
's/ CONFIG-ONLY PAGE=$(PAGE)//g' $(srcdir)/doc
/page.style \
204 |grep
-v
'CONFIG-ONLY' \
206 |awk
'{print "\"" $$0 "\\n\""}' >> latex-style.c
207 @echo
';' >> latex-style.c
208 @echo
'' >> latex-style.c
209 @echo
'/*+ The cxref style file as a string. +*/' >> latex-style.c
210 @echo
'char *latex_cxref_style=' >> latex-style.c
211 @sed
's/\\/\\\\/g' $(srcdir)/doc
/cxref.style \
212 |awk
'{print "\"" $$0 "\\n\""}' >> latex-style.c
213 @echo
';' >> latex-style.c
214 @echo Created latex-style.c
222 $(CC
) -c
$(CFLAGS
) $< -o
$@
$(INCLUDE
) -I.
224 cxref.o
: cxref.c cxref.h datatype.h memory.h parse-yy.h
225 [ ! -f
cpp/cxref-cpp
] ||
$(CC
) -c
$(CFLAGS
) $(srcdir)/cxref.c
-o
$@
$(INCLUDE
) "-DCXREF_CPP=\"$$PWD/cpp/cxref-cpp -cxref-cpp-defines $$PWD/cpp/cxref-cpp.defines -C -dD -dI\""
226 [ -f
cpp/cxref-cpp
] ||
$(CC
) -c
$(CFLAGS
) $(srcdir)/cxref.c
-o
$@
$(INCLUDE
)
228 cxref-inst.o
: cxref.c cxref.h datatype.h memory.h parse-yy.h
229 [ ! -f
cpp/cxref-cpp
] ||
$(CC
) -c
$(CFLAGS
) $(srcdir)/cxref.c
-o
$@
$(INCLUDE
) '-DCXREF_CPP="cxref-cpp -C -dD -dI"'
230 [ -f
cpp/cxref-cpp
] ||
$(CC
) -c
$(CFLAGS
) $(srcdir)/cxref.c
-o
$@
$(INCLUDE
)
232 func.o
: func.c cxref.h datatype.h memory.h parse-yy.h
233 type.o
: type.c cxref.h datatype.h memory.h parse-yy.h
234 var.o
: var.c cxref.h datatype.h memory.h parse-yy.h
235 comment.o
: comment.c cxref.h datatype.h memory.h
236 file.o
: file.c cxref.h datatype.h memory.h
237 preproc.o
: preproc.c cxref.h datatype.h memory.h parse-yy.h
239 slist.o
: slist.c cxref.h datatype.h memory.h
240 memory.o
: memory.c memory.h
242 xref.o
: xref.c cxref.h datatype.h memory.h
244 warn-raw.o
: warn-raw.c cxref.h datatype.h memory.h
245 latex.o
: latex.c cxref.h datatype.h memory.h
246 latex-style.o
: latex-style.c
247 html.o
: html.c cxref.h datatype.h memory.h
248 rtf.o
: rtf.c cxref.h datatype.h memory.h
249 $(CC
) -c
$(CFLAGS
) $(srcdir)/rtf.c
-o
$@
-DPAGE
=\"$(PAGE
)\" $(INCLUDE
)
250 sgml.o
: sgml.c cxref.h datatype.h memory.h
252 parse-yacc.o
: parse-yacc.c cxref.h datatype.h memory.h parse-yy.h parse-yacc.h
253 parse-lex.o
: parse-lex.c cxref.h datatype.h memory.h parse-yy.h parse-yacc.h