config/make.tmpl: Kickstart binaries need to be relatively linked
[AROS.git] / tools / genmodule / writeincclib.c
blobefe586f4cd7f448442b301ce290e98b237ee4662
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Function to write clib/modulename_protos.h. Part of genmodule.
6 */
7 #include "genmodule.h"
9 void writeincclib(struct config *cfg)
11 FILE *out;
12 char line[256], *banner;
13 struct functionhead *funclistit;
14 struct functionarg *arglistit;
15 struct stringlist *linelistit;
17 snprintf(line, 255, "%s/clib/%s_protos.h", cfg->gendir, cfg->modulename);
19 out = fopen(line, "w");
21 if (out == NULL)
23 perror(line);
24 exit(20);
27 banner = getBanner(cfg);
28 fprintf(out,
29 "#ifndef CLIB_%s_PROTOS_H\n"
30 "#define CLIB_%s_PROTOS_H\n"
31 "\n"
32 "%s"
33 "\n"
34 "#include <aros/libcall.h>\n"
35 "\n",
36 cfg->modulenameupper, cfg->modulenameupper, banner
38 freeBanner(banner);
40 for (linelistit = cfg->cdeflines; linelistit!=NULL; linelistit = linelistit->next)
41 fprintf(out, "%s\n", linelistit->s);
43 fprintf(out,
44 "\n"
45 "__BEGIN_DECLS\n"
46 "\n"
49 writefuncprotos(out, cfg, cfg->funclist);
51 fprintf(out,
52 "\n"
53 "__END_DECLS\n"
54 "\n"
55 "#endif /* CLIB_%s_PROTOS_H */\n",
56 cfg->modulenameupper);