Imported Robodoc.
[robodoc.git] / Source / makefile.mingw-cygwin
1 # vi: spell ff=unix
2 #****h* ROBODoc/makefile.mingw-cygwin
3 # NAME
4 #   makefile.mingw-cygwin -- Plain makefile that does not need autoconf 
5 # PURPOSE
6 #   The makefile for MingW Minimalist GNU for Windows under the Cygwin
7 #   environment, See:
8 #   * http://www.mingw.org,
9 #   * http://www.cygwin.com
10 #
11 #   You can use it if you are on a win32 system.
12 #
13 #   The following targets are the most useful for the user:
14 #   * robodoc -  makes the robodoc executable.
15 #
16 #   Developers might try:
17 #   * test  - run system tests
18 #   * clean - clean all results.
19 #
20 # EXAMPLES
21 #   make -f makefile.mingw-cygwin robodoc
22 #   make -f makefile.mingw-cygwin test
23 #   make -f makefile.mingw-cygwin clean
24
25 #****
26 #
27 # $Id: makefile.mingw-cygwin,v 1.17 2007/05/14 15:41:19 petterik Exp $
28 #
29
30 .SUFFIXES:
31 .SUFFIXES: .c .o
32
33 #--------------------------------------
34 # use gcc (generic)
35 #--------------------------------------
36
37 CC = gcc
38 #DEBUG = 1
39
40 #****v* makefile.mingw-cygwin/CFLAGS
41 # FUNCTION
42 #   Defined the flags used for the C compiler:
43 #   *  -W, -Wall and -std=gnu99 --
44 #      This turns on all warnings based on the C99 standard.
45 #      Making the source warning free for an earlier standard is
46 #      not necessary as this code is compiled on Unix, Windows, and
47 #      Mac systems that all have C99 compliant C compilers.
48 #      It also allows some gnu extensions.
49 #      Using -std=c99 gives some spurious warnings about popen()
50 #   * -O3 -- optimize, turning optimization on finds more errors and 
51 #      warnings.
52 #   * -mno-cygwin -- Tells gcc not to link with cygwin1.dll but use the
53 #      windows standard C library. (make mingw windows native executable
54 #      under cygwin)
55 #   * -s -- Strip debug info out from objects, making the executable smaller
56 #   * -g -- Include all debugger info for GDB
57 # SOURCE
58
59 ifdef DEBUG
60 CFLAGS = -g -mno-cygwin -W -Wall -std=gnu99
61 else
62 CFLAGS = -s -mno-cygwin -O3 -W -Wall -std=gnu99
63 endif
64
65 #*****
66
67 LIBS=
68
69 #
70 #
71 #
72
73 ROBODOC=robodoc.exe
74 RM=rm -f
75 all: robodoc.exe
76
77 # currently does not compile: robohdrs
78
79 #****v* makefile.mingw-cygwin/SOURCES, HEADERS
80 # FUNCTION
81 #   All source files needed to compile ROBODoc
82 # SOURCE
83 #
84 SOURCES = \
85           analyser.c \
86           ascii_generator.c \
87           directory.c \
88           document.c \
89           file.c \
90           generator.c \
91           globals.c \
92           headers.c \
93           headertypes.c \
94           html_generator.c \
95           items.c \
96           latex_generator.c \
97           links.c \
98           optioncheck.c \
99           part.c \
100           path.c \
101           roboconfig.c \
102           robodoc.c \
103           rtf_generator.c \
104           test_generator.c \
105           troff_generator.c \
106           util.c \
107           xmldocbook_generator.c
108
109 HEADERS= analyser.h \
110          ascii_generator.h \
111          directory.h \
112          dirwalk.h \
113          document.h \
114          file.h \
115          generator.h \
116          globals.h \
117          headertypes.h \
118          headers.h \
119          html_generator.h \
120          items.h \
121          latex_generator.h \
122          links.h \
123          optioncheck.h \
124          part.h \
125          path.h \
126          roboconfig.h \
127          robodoc.h \
128          rtf_generator.h \
129          troff_generator.h \
130          unittest.h \
131          util.h \
132          test_generator.h \
133          xmldocbook_generator.h
134
135 #*****
136
137 OBJECTS= $(SOURCES:.c=.o)
138
139 #****e* makefile.mingw-cygwin/robodoc
140 # NAME
141 #   robodoc --
142 # NOTE
143 #   This assumes that your version of make knows how to make an .o file
144 #   out of an .c file.
145 # SOURCE
146 #
147
148 $(ROBODOC) : $(OBJECTS) 
149         $(CC) $(CFLAGS) $(OBJECTS) -o $(ROBODOC) $(LIBS)
150
151 #****
152
153 #****e* makefile.mingw-cygwin/robohdrs
154 # NAME
155 #   robohdrs --
156 # SOURCE
157 #
158
159 robohdrs : robohdrs.o headers.o
160         $(CC) robohdrs.o headers.o -o robohdrs
161
162 #****
163
164 html : robodoc.html
165
166 robodoc.html : $(ROBODOC)
167         ./$(ROBODOC) --src ./ --doc robodoc --singledoc --html --sections --toc
168
169 #----------------------------
170 # Development
171 #----------------------------
172
173
174 #****e* makefile.mingw-cygwin/test
175 # NAME
176 #   test -- run some tests
177 # FUNCTION
178 #   Runs robodoc on file with a number of different headers.
179 # HISTORY
180 #   2002-05-19/PetteriK: test cases in Test directory run with this rule
181 #
182 #****
183
184 test : $(ROBODOC)
185         (cd Test; $(MAKE))
186
187 #****e* makefile.mingw-cygwin/clean
188 # NAME
189 #   clean -- Clean up the mess we made.
190 # FUNCTION
191 #   Cleans up the mess we made.
192 #*****
193
194 clean :
195         $(RM) \
196         $(OBJECTS) \
197         $(ROBODOC) \
198         robohdrs \
199         *~ \
200         *.o \
201         *.tex \
202         *.toc \
203         *.dvi \
204         *.aux \
205         *.log \
206         *.ps \
207         robodoc.html \
208         testheaders.html \
209         stamp-h* \
210         makefile.in \
211         config.h \
212
213
214 #------------------------------
215 # Construction of the makefile
216 #------------------------------
217
218 # TODO Figure out how to get rid of all the warnings about
219 #      standard includes such as <stdio.h> etc
220 depend :
221         makedepend -Y"" -f makefile.mingw-cygwin $(SOURCES) $(HEADERS)
222
223 depend2:
224         $(CC) -MM $(SOURCES)
225
226 # DO NOT DELETE
227
228 analyser.o: analyser.c robodoc.h globals.h headers.h headertypes.h \
229   items.h util.h document.h links.h analyser.h file.h path.h part.h \
230   roboconfig.h
231 ascii_generator.o: ascii_generator.c ascii_generator.h headers.h util.h \
232   document.h robodoc.h globals.h items.h headertypes.h generator.h
233 directory.o: directory.c robodoc.h directory.h file.h path.h links.h \
234   headertypes.h headers.h document.h util.h globals.h roboconfig.h
235 document.o: document.c robodoc.h document.h part.h path.h directory.h \
236   file.h links.h headertypes.h headers.h util.h generator.h globals.h
237 file.o: file.c file.h path.h links.h headertypes.h headers.h document.h \
238   robodoc.h util.h
239 generator.o: generator.c globals.h robodoc.h headers.h items.h util.h \
240   document.h links.h headertypes.h generator.h part.h file.h path.h \
241   roboconfig.h html_generator.h latex_generator.h xmldocbook_generator.h \
242   rtf_generator.h troff_generator.h ascii_generator.h test_generator.h \
243   analyser.h
244 globals.o: globals.c robodoc.h globals.h links.h headertypes.h headers.h \
245   document.h
246 headers.o: headers.c robodoc.h headers.h globals.h roboconfig.h util.h \
247   document.h
248 headertypes.o: headertypes.c headertypes.h util.h headers.h document.h \
249   robodoc.h
250 html_generator.o: html_generator.c html_generator.h headers.h items.h \
251   robodoc.h document.h util.h globals.h links.h headertypes.h generator.h \
252   directory.h file.h path.h part.h roboconfig.h
253 items.o: items.c globals.h robodoc.h items.h roboconfig.h util.h \
254   headers.h document.h
255 latex_generator.o: latex_generator.c generator.h robodoc.h headers.h \
256   document.h util.h links.h headertypes.h latex_generator.h globals.h
257 links.o: links.c globals.h robodoc.h headers.h util.h document.h links.h \
258   headertypes.h part.h file.h path.h
259 optioncheck.o: optioncheck.c robodoc.h optioncheck.h roboconfig.h util.h \
260   headers.h document.h
261 part.o: part.c headers.h file.h path.h links.h headertypes.h document.h \
262   robodoc.h part.h util.h
263 path.o: path.c path.h robodoc.h headers.h util.h document.h
264 roboconfig.o: roboconfig.c headertypes.h util.h headers.h document.h \
265   robodoc.h roboconfig.h globals.h optioncheck.h
266 robodoc.o: robodoc.c robodoc.h globals.h headers.h util.h document.h \
267   links.h headertypes.h part.h analyser.h generator.h directory.h file.h \
268   path.h roboconfig.h optioncheck.h
269 rtf_generator.o: rtf_generator.c rtf_generator.h headers.h util.h \
270   document.h robodoc.h globals.h generator.h
271 test_generator.o: test_generator.c test_generator.h headers.h document.h \
272   robodoc.h globals.h util.h
273 troff_generator.o: troff_generator.c troff_generator.h headers.h items.h \
274   robodoc.h util.h document.h generator.h file.h path.h links.h \
275   headertypes.h part.h
276 util.o: util.c robodoc.h globals.h links.h headertypes.h headers.h \
277   document.h path.h util.h
278 xmldocbook_generator.o: xmldocbook_generator.c xmldocbook_generator.h \
279   headers.h document.h robodoc.h globals.h util.h