/* can be NULL while c1mode or linking without compiling */
char *fullDstFileName; /* full name for the output file; */
/* only given by -o, otherwise NULL */
-size_t fullDstFileNameLen; /* size of previous string. */
char *dstFileName; /* destination file name without extension */
char *dstPath = ""; /* path for the output files; */
/* "" is equivalent with cwd */
static char *
getStringArg(const char *szStart, char **argv, int *pi, int argc)
{
- if (argv[*pi][strlen(szStart)])
+ if (argv[*pi][strlen(szStart)])
{
return &argv[*pi][strlen(szStart)];
}
- else
+ else
{
++(*pi);
- if (*pi >= argc)
+ if (*pi >= argc)
{
werror (E_ARGUMENT_MISSING, szStart);
/* Die here rather than checking for errors later. */
exit(-1);
}
- else
+ else
{
return argv[*pi];
}
}
/** Gets the integer argument to this option using the same rules as
- getStringArg.
+ getStringArg.
*/
static int
getIntArg(const char *szStart, char **argv, int *pi, int argc)
else
{
fullDstFileName = Safe_strdup (buffer);
- fullDstFileNameLen = strlen(fullDstFileName) + 1;
/* get rid of the "."-extension */
/* if debug option is set then open the cdbFile */
if (options.debug && fullSrcFileName)
{
- SNPRINTF (scratchFileName, sizeof(scratchFileName),
+ SNPRINTF (scratchFileName, sizeof(scratchFileName),
"%s.adb", dstFileName); //JCF: Nov 30, 2002
if(debugFile->openFile(scratchFileName))
debugFile->writeModule(moduleName);
int i, system_ret;
/* first we need to create the <filename>.lnk file */
- SNPRINTF (scratchFileName, sizeof(scratchFileName),
+ SNPRINTF (scratchFileName, sizeof(scratchFileName),
"%s.lnk", dstFileName);
if (!(lnkfile = fopen (scratchFileName, "w")))
{
"Add support for your FLAT24 target in %s @ line %d\n",
__FILE__, __LINE__);
exit(-1);
- }
+ }
}
#endif
else
{
strncpyz (scratchFileName, relFiles[0], sizeof(scratchFileName));
- /* strip "rel" extension */
+ /* strip ".rel" extension */
p = strrchr (scratchFileName, '.');
if (p)
{
- p++;
- *p = 0;
+ *p = 0;
}
-
}
strncatz (scratchFileName,
- options.out_fmt ? "S19" : "ihx",
+ options.out_fmt ? ".S19" : ".ihx",
sizeof(scratchFileName));
rename (scratchFileName, fullDstFileName);
- q = strrchr (fullDstFileName, '.');
- if (q)
- {
- /* point after the '.' of the extension */
- q++;
- }
- else
+ strncpyz (buffer, fullDstFileName, sizeof(buffer));
+ q = strrchr (buffer, '.');
+ if (!q)
{
/* no extension: append new extensions */
- /* Don't we want to append a period here ? */
- q = strlen (fullDstFileName) + fullDstFileName;
+ q = strlen (buffer) + buffer;
}
-
- *p = 0;
- strncatz (scratchFileName, "map", sizeof(scratchFileName));
+
+ *p = 0;
+ strncatz (scratchFileName, ".map", sizeof(scratchFileName));
*q = 0;
- strncatz(fullDstFileName, "map", fullDstFileNameLen);
- rename (scratchFileName, fullDstFileName);
- *p = 0;
- strncatz (scratchFileName, "mem", sizeof(scratchFileName));
+ strncatz(buffer, ".map", sizeof(buffer));
+ rename (scratchFileName, buffer);
+ *p = 0;
+ strncatz (scratchFileName, ".mem", sizeof(scratchFileName));
*q = 0;
- strncatz(fullDstFileName, "mem", fullDstFileNameLen);
- rename (scratchFileName, fullDstFileName);
+ strncatz(buffer, ".mem", sizeof(buffer));
+ rename (scratchFileName, buffer);
}
if (system_ret)
{
# Test all of the ports
test-ports:
- for i in $(ALL_PORTS); do $(MAKE) inter-port-clean test-port PORT=$$i; done
+ for i in $(ALL_PORTS); do $(MAKE) test-port PORT=$$i; done
# Helper rule for testing the z80 port only
test-z80:
- $(MAKE) inter-port-clean test-port PORT=z80
+ $(MAKE) test-port PORT=z80
# Helper rule for testing the z80 port only
test-gbz80:
- $(MAKE) inter-port-clean test-port PORT=gbz80
+ $(MAKE) test-port PORT=gbz80
# Helper rule for testing the mcs51 port only
test-mcs51:
- $(MAKE) inter-port-clean test-port PORT=mcs51
+ $(MAKE) test-port PORT=mcs51
test-mcs51-large:
- $(MAKE) inter-port-clean test-port PORT=mcs51-large
+ $(MAKE) test-port PORT=mcs51-large
test-mcs51-stack-auto:
- $(MAKE) inter-port-clean make-library test-port PORT=mcs51-stack-auto
+ $(MAKE) make-library test-port PORT=mcs51-stack-auto
# Helper rule for testing the ds390 port only
test-ds390:
- $(MAKE) inter-port-clean test-port PORT=ds390
+ $(MAKE) test-port PORT=ds390
# Helper rule for testing the z80 port only(use ucSim simulator)
test-ucz80:
- $(MAKE) inter-port-clean test-port PORT=ucz80
+ $(MAKE) test-port PORT=ucz80
# Helper rule for testing the xa51 port only(use ucSim simulator)
test-xa51:
- $(MAKE) inter-port-clean test-port PORT=xa51
+ $(MAKE) test-port PORT=xa51
### Helper rule for testing the host cc only
test-host:
- $(MAKE) inter-port-clean test-port PORT=host
+ $(MAKE) test-port PORT=host
test-host2:
$(MAKE) test-port PORT=host
# Rule to generate the iterations of a test suite off the soure suite.
$(PORT_CASES_DIR)/%/iterations.stamp: $(TESTS_DIR)/%.c $(GENERATE_CASES)
echo Processing $<
+ rm -rf `dirname $@`
mkdir -p `dirname $@`
python $(GENERATE_CASES) $< `dirname $@` > /dev/null
touch $@
# BeginGeneric rules
-clean: inter-port-clean
+clean:
rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc fwk/lib/timeout fwk/lib/timeout.exe
for i in $(CLEAN_PORTS); do $(MAKE) -f $(PORTS_DIR)/$$i/spec.mk _clean PORTS_DIR=$(PORTS_DIR) PORT=$$i; done
-
-inter-port-clean:
- rm -f fwk/lib/*.o fwk/lib/*.asm fwk/lib/*.rst fwk/lib/*.lst fwk/lib/*.rel \
- fwk/lib/*.ihx fwk/lib/*.map fwk/lib/*.sym