2 * udibuild - UDI Compilation Utility
3 * - By John Hodge (thePowersGang)
6 * - Compilation functions
10 #include "include/build.h"
11 #include "include/common.h"
14 # define __attribute__(...)
18 char *get_objfile(tIniFile *opts, const char *srcfile);
21 int Build_CompileFile(tIniFile *opts, const char *abi, tUdiprops *udiprops, tUdiprops_Srcfile *srcfile)
23 // Select compiler from opts [abi]
24 const char *cc_prog = IniFile_Get(opts, abi, "CC", NULL);
26 fprintf(stderr, "No 'CC' defined for ABI %s\n", abi);
30 // Build up compiler's command line
31 // - Include CFLAGS from .ini file
32 // - defines from udiprops
33 // - Object file is srcfile with .o appended
34 // > Place in 'obj/' dir?
35 char *objfile = get_objfile(opts, srcfile->Filename);
36 char *cmd = mkstr("%s -DUDI_ABI_is_%s %s %s -c %s -o %s",
39 IniFile_Get(opts, abi, "CFLAGS", ""),
40 srcfile->CompileOpts ? srcfile->CompileOpts : "",
41 srcfile->Filename, objfile);
42 printf("--- Compiling: %s\n", srcfile->Filename);
50 int Build_LinkObjects(tIniFile *opts, const char *abi, tUdiprops *udiprops)
55 char *get_objfile(tIniFile *opts, const char *srcfile)
57 return mkstr("%s.o", srcfile);