NASM 0.95
[platform/upstream/nasm.git] / outform.h
1 /* outform.h    header file for binding output format drivers to the
2  *              remainder of the code in the Netwide Assembler
3  *
4  * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
5  * Julian Hall. All rights reserved. The software is
6  * redistributable under the licence given in the file "Licence"
7  * distributed in the NASM archive.
8  */
9
10 /*
11  * This header file allows configuration of which output formats
12  * get compiled into the NASM binary. You can configure by defining
13  * various preprocessor symbols beginning with "OF_", either on the
14  * compiler command line or at the top of this file.
15  *
16  * OF_ONLY                -- only include specified object formats
17  * OF_name                -- ensure that output format 'name' is included
18  * OF_NO_name             -- remove output format 'name'
19  * OF_DOS                 -- ensure that 'obj', 'bin' & 'win32' are included.
20  * OF_UNIX                -- ensure that 'aout', 'coff' and 'elf' are in.
21  * OF_OTHERS              -- ensure that 'bin', 'as86', 'os2' & 'rdf' are in.
22  * OF_ALL                 -- ensure that all formats are included.
23  *
24  * OF_DEFAULT=of_name     -- ensure that 'name' is the default format.
25  *
26  * eg: -DOF_UNIX -DOF_ELF -DOF_DEFAULT=of_elf would be a suitable config
27  * for an average linux system.
28  *
29  * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
30  *
31  * You probably only want to set these options while compiling 'nasm.c'. */
32
33 #ifndef NASM_OUTFORM_H
34 #define NASM_OUTFORM_H
35
36 #include "nasm.h"
37
38 #define MAX_OUTPUT_FORMATS 16
39
40 struct ofmt *ofmt_find(char *);
41 void ofmt_list(struct ofmt *, FILE *);
42 void ofmt_register (struct ofmt *);
43
44 /* -------------- USER MODIFIABLE PART ---------------- */
45
46 /*
47  * Insert #defines here in accordance with the configuration
48  * instructions above.
49  *
50  * E.g.
51  *
52  * #define OF_ONLY
53  * #define OF_OBJ
54  * #define OF_BIN
55  *
56  * for a 16-bit DOS assembler with no extraneous formats.
57  */
58
59 /* ------------ END USER MODIFIABLE PART -------------- */
60
61 /* ====configurable info begins here==== */
62 /* formats configurable:
63  * bin,obj,elf,aout,coff,win32,as86,rdf */
64
65 /* process options... */
66
67 #ifndef OF_ONLY
68 #ifndef OF_ALL
69 #define OF_ALL      /* default is to have all formats */
70 #endif
71 #endif
72
73 #ifdef OF_ALL      /* set all formats on... */
74 #ifndef OF_BIN
75 #define OF_BIN
76 #endif
77 #ifndef OF_OBJ
78 #define OF_OBJ
79 #endif
80 #ifndef OF_OS2
81 #define OF_OS2
82 #endif
83 #ifndef OF_ELF
84 #define OF_ELF
85 #endif
86 #ifndef OF_COFF
87 #define OF_COFF
88 #endif
89 #ifndef OF_AOUT
90 #define OF_AOUT
91 #endif
92 #ifndef OF_WIN32
93 #define OF_WIN32
94 #endif
95 #ifndef OF_AS86
96 #define OF_AS86
97 #endif
98 #ifndef OF_RDF
99 #define OF_RDF
100 #endif
101 #endif /* OF_ALL */
102
103 /* turn on groups of formats specified.... */
104 #ifdef OF_DOS
105 #ifndef OF_OBJ
106 #define OF_OBJ
107 #endif
108 #ifndef OF_BIN
109 #define OF_BIN
110 #endif
111 #ifndef OF_WIN32
112 #define OF_WIN32
113 #endif
114 #endif
115
116 #ifdef OF_UNIX
117 #ifndef OF_AOUT
118 #define OF_AOUT
119 #endif
120 #ifndef OF_COFF
121 #define OF_COFF
122 #endif
123 #ifndef OF_ELF
124 #define OF_ELF
125 #endif
126 #endif
127
128 #ifdef OF_OTHERS
129 #ifndef OF_BIN
130 #define OF_BIN
131 #endif
132 #ifndef OF_AS86
133 #define OF_AS86
134 #endif
135 #ifndef OF_RDF
136 #define OF_RDF
137 #endif
138 #ifndef OF_OS2
139 #define OF_OS2
140 #endif
141 #endif
142
143 /* finally... override any format specifically specifed to be off */
144 #ifdef OF_NO_BIN
145 #undef OF_BIN
146 #endif
147 #ifdef OF_NO_OBJ
148 #undef OF_OBJ
149 #endif
150 #ifdef OF_NO_ELF
151 #undef OF_ELF
152 #endif
153 #ifdef OF_NO_AOUT
154 #undef OF_AOUT
155 #endif
156 #ifdef OF_NO_COFF
157 #undef OF_COFF
158 #endif
159 #ifdef OF_NO_WIN32
160 #undef OF_WIN32
161 #endif
162 #ifdef OF_NO_AS86
163 #undef OF_AS86
164 #endif
165 #ifdef OF_NO_RDF
166 #undef OF_RDF
167 #endif
168 #ifdef OF_NO_OS2
169 #undef OF_OS2
170 #endif
171
172 #ifndef OF_DEFAULT
173 #define OF_DEFAULT of_bin
174 #endif
175
176 #endif  /* NASM_OUTFORM_H */