tools/genmodule: Bring back xxx_GetLibbase() functions.
[AROS.git] / tools / genmodule / genmodule.c
blobda9445768e0b3f30db788aa9910196f8bec55759
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->modtype == LIBRARY)
26 writegetlibbase(cfg, 0); /* normal */
27 writegetlibbase(cfg, 1); /* relbase */
29 if (cfg->options & OPTION_STUBS)
31 writestubs(cfg, 0); /* normal */
32 writestubs(cfg, 1); /* relbase */
34 break;
36 case INCLUDES:
37 if (cfg->options & OPTION_INCLUDES)
39 writeincproto(cfg, 0); /* normal */
40 writeincproto(cfg, 1); /* relbase */
41 writeincclib(cfg);
42 writeincdefines(cfg);
43 writeincinline(cfg);
45 if (cfg->interfacelist)
46 writeincinterfaces(cfg);
47 break;
49 case LIBDEFS:
50 writeinclibdefs(cfg);
51 break;
53 case MAKEFILE:
54 writemakefile(cfg);
55 break;
57 case WRITEFUNCLIST:
58 /* Ignore the functionlist and the methodlist that are available in the
59 * .conf file.
61 cfg->funclist = NULL;
62 if (cfg->classlist != NULL)
63 cfg->classlist->methlist = NULL;
65 writefunclist(cfg);
66 break;
68 case WRITEFD:
69 writefd(cfg);
70 break;
72 case WRITESKEL:
73 writeskel(cfg);
74 break;
76 default:
77 fprintf(stderr, "Internal error in main: Unhandled command type\n");
78 exit(20);
81 return 0;