NASM 0.98.16
[nasm/avx512.git] / outforms.h
blob2afbbe27d952081966d7dc82cd34f7ed41761d25
1 /* outform.h header file for binding output format drivers to the
2 * remainder of the code in the Netwide Assembler
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 */
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.
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', 'aoutb', 'coff', 'elf' are in.
21 * OF_OTHERS -- ensure that 'bin', 'as86' & 'rdf' are in.
22 * OF_ALL -- ensure that all formats are included.
24 * OF_DEFAULT=of_name -- ensure that 'name' is the default format.
26 * eg: -DOF_UNIX -DOF_ELF -DOF_DEFAULT=of_elf would be a suitable config
27 * for an average linux system.
29 * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
31 * You probably only want to set these options while compiling 'nasm.c'. */
33 #ifndef NASM_OUTFORMS_H
34 #define NASM_OUTFORMS_H
36 #include "nasm.h"
38 /* -------------- USER MODIFIABLE PART ---------------- */
41 * Insert #defines here in accordance with the configuration
42 * instructions above.
44 * E.g.
46 * #define OF_ONLY
47 * #define OF_OBJ
48 * #define OF_BIN
50 * for a 16-bit DOS assembler with no extraneous formats.
53 /* ------------ END USER MODIFIABLE PART -------------- */
55 /* ====configurable info begins here==== */
56 /* formats configurable:
57 * bin,obj,elf,aout,aoutb,coff,win32,as86,rdf */
59 /* process options... */
61 #ifndef OF_ONLY
62 #ifndef OF_ALL
63 #define OF_ALL /* default is to have all formats */
64 #endif
65 #endif
67 #ifdef OF_ALL /* set all formats on... */
68 #ifndef OF_BIN
69 #define OF_BIN
70 #endif
71 #ifndef OF_OBJ
72 #define OF_OBJ
73 #endif
74 #ifndef OF_ELF
75 #define OF_ELF
76 #endif
77 #ifndef OF_COFF
78 #define OF_COFF
79 #endif
80 #ifndef OF_AOUT
81 #define OF_AOUT
82 #endif
83 #ifndef OF_AOUTB
84 #define OF_AOUTB
85 #endif
86 #ifndef OF_WIN32
87 #define OF_WIN32
88 #endif
89 #ifndef OF_AS86
90 #define OF_AS86
91 #endif
92 #ifndef OF_RDF
93 #define OF_RDF
94 #endif
95 #endif /* OF_ALL */
97 /* turn on groups of formats specified.... */
98 #ifdef OF_DOS
99 #ifndef OF_OBJ
100 #define OF_OBJ
101 #endif
102 #ifndef OF_BIN
103 #define OF_BIN
104 #endif
105 #ifndef OF_WIN32
106 #define OF_WIN32
107 #endif
108 #endif
110 #ifdef OF_UNIX
111 #ifndef OF_AOUT
112 #define OF_AOUT
113 #endif
114 #ifndef OF_AOUTB
115 #define OF_AOUTB
116 #endif
117 #ifndef OF_COFF
118 #define OF_COFF
119 #endif
120 #ifndef OF_ELF
121 #define OF_ELF
122 #endif
123 #endif
125 #ifdef OF_OTHERS
126 #ifndef OF_BIN
127 #define OF_BIN
128 #endif
129 #ifndef OF_AS86
130 #define OF_AS86
131 #endif
132 #ifndef OF_RDF
133 #define OF_RDF
134 #endif
135 #endif
137 /* finally... override any format specifically specifed to be off */
138 #ifdef OF_NO_BIN
139 #undef OF_BIN
140 #endif
141 #ifdef OF_NO_OBJ
142 #undef OF_OBJ
143 #endif
144 #ifdef OF_NO_ELF
145 #undef OF_ELF
146 #endif
147 #ifdef OF_NO_AOUT
148 #undef OF_AOUT
149 #endif
150 #ifdef OF_NO_AOUTB
151 #undef OF_AOUTB
152 #endif
153 #ifdef OF_NO_COFF
154 #undef OF_COFF
155 #endif
156 #ifdef OF_NO_WIN32
157 #undef OF_WIN32
158 #endif
159 #ifdef OF_NO_AS86
160 #undef OF_AS86
161 #endif
162 #ifdef OF_NO_RDF
163 #undef OF_RDF
164 #endif
166 #ifndef OF_DEFAULT
167 #define OF_DEFAULT of_bin
168 #endif
170 #ifdef BUILD_DRIVERS_ARRAY /* only if included from outform.c */
172 /* pull in the externs for the different formats, then make the *drivers
173 * array based on the above defines */
175 extern struct ofmt of_bin;
176 extern struct ofmt of_aout;
177 extern struct ofmt of_aoutb;
178 extern struct ofmt of_coff;
179 extern struct ofmt of_elf;
180 extern struct ofmt of_as86;
181 extern struct ofmt of_obj;
182 extern struct ofmt of_win32;
183 extern struct ofmt of_rdf;
184 extern struct ofmt of_dbg;
186 struct ofmt *drivers[]={
187 #ifdef OF_BIN
188 &of_bin,
189 #endif
190 #ifdef OF_AOUT
191 &of_aout,
192 #endif
193 #ifdef OF_AOUTB
194 &of_aoutb,
195 #endif
196 #ifdef OF_COFF
197 &of_coff,
198 #endif
199 #ifdef OF_ELF
200 &of_elf,
201 #endif
202 #ifdef OF_AS86
203 &of_as86,
204 #endif
205 #ifdef OF_OBJ
206 &of_obj,
207 #endif
208 #ifdef OF_WIN32
209 &of_win32,
210 #endif
211 #ifdef OF_RDF
212 &of_rdf,
213 #endif
214 #ifdef OF_DBG
215 &of_dbg,
216 #endif
218 NULL
221 #endif /* BUILD_DRIVERS_ARRAY */
223 #endif /* NASM_OUTFORMS_H */