Fixed Autodoc formatting.
[AROS.git] / tools / cxref / Makefile.in
blob662f13624fc15630bc4ee7f0a8ead061b5bed618
1 # $Header$
3 # C Cross Referencing & Documentation tool. Version 1.5g.
5 # Program Makefile.
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.
15 # autoconf things
17 objdir=@objdir@
18 srcdir=@srcdir@
19 VPATH=@srcdir@
21 # The installation locations
23 prefix=@prefix@
24 exec_prefix=@exec_prefix@
25 bindir=$(DESTDIR)@bindir@
26 mandir=$(DESTDIR)@mandir@
28 # The installation program.
30 INSTALL=@INSTALL@
32 # The C compiler and linker
34 CC=@CC@
35 LD=@CC@
37 CFLAGS=@CFLAGS@
38 LDFLAGS=@LDFLAGS@
40 # The Yacc program
42 YACC=@YACC@
44 YACCFLAGS=-d
45 BISONFLAGS=-d
47 # The Lex Program
49 LEX=@LEX@
51 LEXFLAGS=
52 FLEXFLAGS=-p -B -F -8 -s
54 # The Perl program
56 PERL=@PERL@
58 # The LaTeX and dvips programs
60 LATEX=@LATEX@
61 DVIPS=@DVIPS@
63 # The page size (for LaTeX and RTF).
64 # (A4 or US only.)
66 PAGE=@PAGE@
68 ########
70 INCLUDE=-I.
71 LIBRARY=@LIBS@
73 ########
75 programs : cxref-cpp cxref cxref-inst cxref-query
77 docs : readme faq-html
78 cd doc && $(MAKE)
80 all : programs docs
82 ########
84 OBJ_FILES=func.o type.o var.o preproc.o comment.o file.o \
85 slist.o memory.o \
86 xref.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)
96 ####
98 cxref-cpp :
99 cd cpp && $(MAKE) programs
101 ####
103 cxref-query :
104 cd query && $(MAKE) programs
106 ########
108 faq-html : FAQ FAQ-html.pl
109 [ "x$(PERL)" = "x" ] || $(PERL) $(srcdir)/FAQ-html.pl < $(srcdir)/FAQ > FAQ.html
111 ####
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.*
126 ########
128 install : programs
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
144 ########
146 clean :
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 \
150 README.dvi README.ps
151 cd cpp && $(MAKE) clean
152 cd doc && $(MAKE) clean
153 cd query && $(MAKE) clean
155 ####
157 distclean : 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
164 ########
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 \
174 rm y.tab.h ; \
175 else \
176 if [ -f y.tab.h ] ; then \
177 cp y.tab.h parse-yacc.h ; \
178 echo Created parse-yacc.h ; \
179 fi \
182 ####
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
190 ####
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' \
205 |sed 's/\\/\\\\/g' \
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
216 ####
218 .SUFFIXES:
219 .SUFFIXES: .c .o
221 .c.o:
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
255 ########