2 Copyright © 2005, 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 fprintf(out
, "%s_LINKLIBAFILES :=", cfg
->modulename
);
47 if ((cfg
->options
& OPTION_STUBS
) && (cfg
->intcfg
& CFG_GENASTUBS
))
48 fprintf(out
, "%s_astubs\n", cfg
->modulename
);
51 fprintf(out
, "%s_INCLUDES := ", cfg
->modulename
);
52 if (cfg
->options
& OPTION_INCLUDES
)
55 "clib/%s_protos.h defines/%s.h proto/%s.h",
56 cfg
->modulename
, cfg
->modulename
, cfg
->modulename
63 cfg
->modulename
, (cfg
->intcfg
& CFG_NOREADREF
) ? "no" : "yes"
68 perror("Error writing Makefile");