Removed codesetslib because we have now external repo.
[cake.git] / tools / genmodule / genmodule.c
blobee8bc63ada053ea3b64a23a7a8e4e58ae1dd04f6
1 /*
2 Copyright © 1995-2005, 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 if (!(cfg->intcfg & CFG_NOREADREF))
18 readref(cfg);
19 writestart(cfg);
20 writeend(cfg);
21 if (cfg->modtype == LIBRARY)
22 writeautoinit(cfg);
23 writestubs(cfg);
24 break;
26 case INCLUDES:
27 if (!(cfg->intcfg & CFG_NOREADREF))
28 readref(cfg);
29 /* fall through */
30 case DUMMY:
31 writeincproto(cfg);
32 writeincclib(cfg);
33 writeincdefines(cfg);
34 break;
36 case LIBDEFS:
37 writeinclibdefs(cfg);
38 break;
40 case MAKEFILE:
41 writemakefile(cfg);
42 break;
44 case WRITEFUNCLIST:
45 /* Ignore the functionlist and the methodlist that are available in the
46 * .conf file.
48 cfg->funclist = NULL;
49 if (cfg->classlist != NULL)
50 cfg->classlist->methlist = NULL;
52 readref(cfg);
53 writefunclist(cfg);
54 break;
56 default:
57 fprintf(stderr, "Internal error in main: Unhandled command type\n");
58 exit(20);
61 return 0;