#define OPTION_PACK_IRAM "--pack-iram"
#define OPTION_NO_PACK_IRAM "--no-pack-iram"
#define OPTION_NO_PEEP_COMMENTS "--no-peep-comments"
+#define OPTION_VERBOSE_ASM "--fverbose-asm"
#define OPTION_OPT_CODE_SPEED "--opt-code-speed"
#define OPTION_OPT_CODE_SIZE "--opt-code-size"
#define OPTION_STD_C89 "--std-c89"
#define OPTION_CODE_SEG "--codeseg"
#define OPTION_CONST_SEG "--constseg"
#define OPTION_DOLLARS_IN_IDENT "--fdollars-in-identifiers"
+#define OPTION_UNSIGNED_CHAR "--funsigned-char"
static const OPTION
optionsTable[] = {
{ 0, OPTION_STD_C99, NULL, "Use C99 standard only (incomplete)" },
{ 0, OPTION_STD_SDCC99, NULL, "Use C99 standard with SDCC extensions (incomplete)" },
{ 0, OPTION_DOLLARS_IN_IDENT, &options.dollars_in_ident, "Permit '$' as an identifier character" },
+ { 0, OPTION_UNSIGNED_CHAR, &options.unsigned_char, "Make \"char\" unsigned by default" },
{ 0, NULL, NULL, "Code generation options"},
{ 'm', NULL, NULL, "Set the port to use e.g. -mz80." },
{ 0, OPTION_NO_XINIT_OPT, &options.noXinitOpt, "don't memcpy initialized xram from code"},
{ 0, OPTION_NO_CCODE_IN_ASM, &options.noCcodeInAsm, "don't include c-code as comments in the asm file"},
{ 0, OPTION_NO_PEEP_COMMENTS, &options.noPeepComments, "don't include peephole optimizer comments"},
+ { 0, OPTION_VERBOSE_ASM, &options.verboseAsm, "don't include code generator comments"},
#if !OPT_DISABLE_Z80 || !OPT_DISABLE_GBZ80
{ 0, "--no-std-crt0", &options.no_std_crt0, "For the z80/gbz80 do not link default crt0.o"},
#endif
if (*dstPath != '\0')
{
+ dbuf_init(&path, 128);
dbuf_makePath (&path, dstPath, moduleNameBase);
dbuf_c_str (&path);
dstFileName = dbuf_detach (&path);
dbuf_init(&file, 128);
+ /* get rid of the "."-extension */
+ dbuf_splitFile (s, &file, NULL);
+
+ dbuf_c_str (&file);
+ s = dbuf_detach (&file);
+
+ dbuf_init (&file, 128);
+
dbuf_splitPath (s, NULL, &file);
if (*dstPath != '\0')
if (TARGET_IS_MCS51)
{
options.float_rent++;
- }
- /* set up external stack location if not explicitly specified */
- if (!options.xstack_loc)
- options.xstack_loc = options.xdata_loc;
+ /* set up external stack location if not explicitly specified */
+ if (!options.xstack_loc)
+ options.xstack_loc = options.xdata_loc;
+ }
/* if debug option is set then open the cdbFile */
if (options.debug && fullSrcFileName)
char linkerScriptFileName[PATH_MAX];
linkerScriptFileName[0] = 0;
+ c = NULL;
- if(port->linker.needLinkerScript)
+ if (port->linker.needLinkerScript)
{
char out_fmt;
}
/* first we need to create the <filename>.lnk file */
- SNPRINTF (linkerScriptFileName, sizeof(scratchFileName),
+ SNPRINTF (linkerScriptFileName, sizeof(linkerScriptFileName),
"%s.lnk", dstFileName);
if (!(lnkfile = fopen (linkerScriptFileName, "w")))
{
}
#define WRITE_SEG_LOC(N, L) \
- segName = Safe_strdup(N); \
- c = strtok(segName, " \t"); \
- fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
- if (segName) { Safe_free(segName); }
+ if (N) \
+ { \
+ segName = Safe_strdup(N); \
+ c = strtok(segName, " \t"); \
+ fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
+ if (segName) { Safe_free(segName); } \
+ }
if (!(TARGET_Z80_LIKE)) /*Not for the z80, gbz80*/
{
/* if using dollar signs in identifiers */
if (options.dollars_in_ident)
- addSet(&preArgvSet, Safe_strdup("--fdollars-in-identifiers"));
+ addSet(&preArgvSet, Safe_strdup("-fdollars-in-identifiers"));
/* if using external stack define the macro */
if (options.useXstack)
if (port && port->processor && TARGET_IS_PIC) {
char proc[512];
- SNPRINTF(&proc[0], 512, "-DSDCC_PROCESSOR=\"%s\"", port->processor);
- addSet(&preArgvSet, Safe_strdup(proc));
+ SNPRINTF(&proc[0], 512, "-DSDCC_PROCESSOR=\"%s\"", port->processor);
+ addSet(&preArgvSet, Safe_strdup(proc));
}
/* standard include path */