2 Copyright © 2005-2011, The AROS Development Team. All rights reserved.
5 Code to write a Makefile with variables that provides the files
6 and configuration for building the module
12 #include "genmodule.h"
15 void writemakefile(struct config
*cfg
)
20 snprintf(name
, sizeof(name
), "%s/Makefile.%s", cfg
->gendir
, cfg
->modulename
);
22 out
= fopen(name
, "w");
31 "%s_STARTFILES := %s_start\n"
32 "%s_ENDFILES := %s_end\n"
34 cfg
->modulename
, cfg
->modulename
,
35 cfg
->modulename
, cfg
->modulename
,
36 cfg
->modulename
, cfg
->moddir
39 fprintf(out
, "%s_LINKLIBFILES :=", cfg
->modulename
);
40 if (cfg
->options
& OPTION_STUBS
)
41 fprintf(out
, " %s_stubs", cfg
->modulename
);
42 if (cfg
->options
& OPTION_AUTOINIT
)
43 fprintf(out
, " %s_autoinit", cfg
->modulename
);
46 /* Currently there are no asm files anymore */
47 fprintf(out
, "%s_LINKLIBAFILES :=\n", cfg
->modulename
);
49 fprintf(out
, "%s_INCLUDES := ", cfg
->modulename
);
50 if (cfg
->options
& OPTION_INCLUDES
)
53 "clib/%s_protos.h inline/%s.h defines/%s.h proto/%s.h",
54 cfg
->modulename
, cfg
->modulename
, cfg
->modulename
, cfg
->modulename
61 perror("Error writing Makefile");