tools/genmodule: include aros/relbase.h in _start.c file when it is a relbase shared...
[AROS.git] / tools / genmodule / genmodule.c
blob688f5ee9cdb93d4a05971cde3e94e00a0b79d057
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Main for genmodule. A tool to generate files for building modules.
6 */
7 #include "genmodule.h"
9 int main(int argc, char **argv)
11 char *s;
12 struct config *cfg = initconfig(argc, argv);
14 switch (cfg->command)
16 case FILES:
17 writestart(cfg);
18 writeend(cfg);
19 if (cfg->options & OPTION_AUTOINIT)
21 writeautoinit(cfg, 0); /* normal */
22 writeautoinit(cfg, 1); /* relbase */
24 if (cfg->options & OPTION_STUBS)
26 writestubs(cfg, 0); /* normal */
27 writestubs(cfg, 1); /* relbase */
29 break;
31 case INCLUDES:
32 if (!(cfg->options & OPTION_INCLUDES))
34 fprintf(stderr, "%s called with writeincludes when no includes are present\n", argv[0]);
35 exit(20);
37 writeincproto(cfg, 0); /* normal */
38 writeincproto(cfg, 1); /* relbase */
39 writeincclib(cfg);
40 writeincdefines(cfg);
41 writeincinline(cfg);
42 break;
44 case LIBDEFS:
45 writeinclibdefs(cfg);
46 break;
48 case MAKEFILE:
49 writemakefile(cfg);
50 break;
52 case WRITEFUNCLIST:
53 /* Ignore the functionlist and the methodlist that are available in the
54 * .conf file.
56 cfg->funclist = NULL;
57 if (cfg->classlist != NULL)
58 cfg->classlist->methlist = NULL;
60 writefunclist(cfg);
61 break;
63 case WRITEFD:
64 writefd(cfg);
65 break;
67 case WRITESKEL:
68 writeskel(cfg);
69 break;
71 default:
72 fprintf(stderr, "Internal error in main: Unhandled command type\n");
73 exit(20);
76 return 0;