--- /dev/null
+# Generated automatically from Makefile.in by configure.
+#
+#
+#
+
+PRJDIR = ..
+
+# !include $(PRJDIR)/Makefile.common
+
+PORTS = mcs51 z80
+PORT_LIBS = mcs51/port.lib z80/port.lib
+
+LIBS = -lgc
+LIBDIRS = -L$(PRJDIR)/support/gc
+LIBGC = $(PRJDIR)/support/gc/gc.lib
+
+OBJECTS = SDCCy.obj SDCClex.obj SDCCerr.obj SDCChasht.obj SDCCmain.obj \
+ SDCCsymt.obj SDCCopt.obj SDCCast.obj SDCCmem.obj SDCCval.obj \
+ SDCCicode.obj SDCCbitv.obj SDCCset.obj SDCClabel.obj \
+ SDCCBBlock.obj SDCCloop.obj SDCCcse.obj SDCCcflow.obj SDCCdflow.obj \
+ SDCClrange.obj SDCCptropt.obj SDCCpeeph.obj SDCCglue.obj
+
+TARGET = $(PRJDIR)/bin/sdcc.exe
+
+# Compiling entire program or any subproject
+# ------------------------------------------
+all: $(LIBGC) $(TARGET)
+
+ports:
+# for i in $(PORTS); do $(MAKE) -C $$i; done
+
+#$(PRJDIR)/support/gc/libgc.a:
+# cd $(PRJDIR)/support/gc && $(MAKE)
+
+
+!include Makefile.dep
+#!include clean.mk
+
+
+# My rules
+# --------
+$(TARGET): $(OBJECTS) $(PORT_LIBS)
+ bcc32 -e$(TARGET) $(OBJECTS) $(PORT_LIBS) $(LIBGC)
+
+CFLAGS = -6 -O -g0 -I. -I.. -I..\support
+
+.c.obj:
+ BCC32 -c $(CFLAGS) $(CPPFLAGS) $<
+
+SDCCy.h: SDCCy.c
+
+SDCCy.c: SDCC.y
+ $(YACC) -d -v -o $@ $<
+
+SDCClex.c: SDCC.lex SDCCy.h
+ $(LEX) -t $< >$@
+
+.y.c:
+ rm -f $*.cc $*.h
+ $(YACC) -d $<
+ mv y.tab.c $*.cc
+ mv y.tab.h $*.h
+
+.l.c:
+ rm -f $*.cc
+ $(LEX) -t $< >$*.cc
+
+
+
cseDef *cdp = item;
iCodeTable *icTab ;
+ (void)ap;
+
if (!cdp->sym)
fprintf(stdout,"**null op**");
printOperand(cdp->sym,stdout);
/* if the conditional is a literal then */
if (IS_OP_LITERAL(IC_COND(ic))) {
- if ( operandLitValue(IC_COND(ic)) && IC_TRUE(ic)) {
+ if ( (operandLitValue(IC_COND(ic)) != 0.0) && IC_TRUE(ic)) {
/* change to a goto */
ic->op = GOTO ;
return IC_RESULT(ic) ;
}
+#ifdef __BORLANDC__
+#define LONG_LONG __int64
+#else
+#define LONG_LONG long long
+#endif
+
/*-----------------------------------------------------------------*/
/* geniCodeLogic- logic code */
/*-----------------------------------------------------------------*/
int nbits = bitsForType(ltype);
long v = operandLitValue(right);
- if (v > ((long long) 1 << nbits) && v > 0)
+ if (v > ((LONG_LONG) 1 << nbits) && v > 0)
werror(W_CONST_RANGE," compare operation ");
}
int nbits = bitsForType(ltype);
long v = operandLitValue(right);
- if (v > ((long long)1 << nbits) && v > 0)
+ if (v > ((LONG_LONG)1 << nbits) && v > 0)
werror(W_CONST_RANGE," = operation");
}
/* if the left & right type don't exactly match */
#include "common.h"
#include <ctype.h>
+
+#ifdef __BORLANDC__
+#include <process.h>
+#else
#include "spawn.h"
+#endif
/* This is a bit messy. We cant include unistd.h as it defines
'link' which we also use.
char *try_dir[]= {SRCDIR "/bin",PREFIX "/bin", NULL};
int my_system (const char *cmd, char **cmd_argv)
{
-
char *dir, *got= NULL; int i= 0;
- while (!got && try_dir[i]) {
- dir= (char*)malloc(strlen(try_dir[i])+strlen(cmd)+10);
- strcpy(dir, try_dir[i]); strcat(dir, "/"); strcat(dir, cmd);
- if (access(dir, X_OK) == 0)
- got= strdup(dir);
- free(dir);
- i++;
+ #ifdef __BORLANDC__
+ char *r;
+ #endif
+
+ while (!got && try_dir[i])
+ {
+ dir= (char*)malloc(strlen(try_dir[i])+strlen(cmd)+10);
+ strcpy(dir, try_dir[i]);
+ strcat(dir, "/");
+ strcat(dir, cmd);
+
+ #ifdef __BORLANDC__
+ strcat(dir, ".exe");
+
+ /* Mung slashes into backslashes to keep WIndoze happy. */
+ r = dir;
+
+ while (*r)
+ {
+ if (*r == '/')
+ {
+ *r = '\\';
+ }
+ r++;
+ }
+ #endif
+
+ if (access(dir, X_OK) == 0)
+ {
+ got= strdup(dir);
+ }
+ free(dir);
+ i++;
}
#if FEATURE_VERBOSE_EXEC
if (verboseExec) {
fclose(yyin);
if (preOutName && !options.c1mode) {
- unlink(preOutName);
- free(preOutName);
+ unlink(preOutName);
+ free(preOutName);
}
return 0;
--- /dev/null
+PRJDIR = ../..
+
+# !include $(PRJDIR)/Makefile.common
+
+OBJ = gen.obj ralloc.obj main.obj
+LIB = port.lib
+
+CFLAGS = -6 -O -g0 -I.. -I. -I..\.. -I..\..\support
+
+.c.obj:
+ BCC32 -c $(CFLAGS) $(CPPFLAGS) $<
+
+all: $(LIB)
+
+main.obj: main.c peeph.rul
+
+$(LIB): peeph.rul $(OBJ)
+ del $(LIB)
+ tlib /a $(LIB) +gen.obj +ralloc.obj +main.obj
+
+peeph.rul: peeph.def
+ gawk -f ../SDCCpeeph.awk peeph.def > peeph.rul
+
+# include clean.mk
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
+#ifndef __BORLANDC__
#warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
#warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
#endif
#endif
+#endif
#include "common.h"
#include "SDCCpeeph.h"
return 0;
}
+#ifdef __BORLANDC__
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
+
/*-----------------------------------------------------------------*/
/* inExcludeList - return 1 if the string is in exclude Reg list */
/*-----------------------------------------------------------------*/
int i =0;
if (options.excludeRegs[i] &&
- strcasecmp(options.excludeRegs[i],"none") == 0)
+ STRCASECMP(options.excludeRegs[i],"none") == 0)
return FALSE ;
for ( i = 0 ; options.excludeRegs[i]; i++) {
if (options.excludeRegs[i] &&
- strcasecmp(s,options.excludeRegs[i]) == 0)
+ STRCASECMP(s,options.excludeRegs[i]) == 0)
return TRUE;
}
return FALSE ;
int useXstack, model, noOverlay;
int stackAuto;
+ char slocBuffer[30];
+
/* first go try and find a free one that is already
existing on the stack */
if (applyToSet(_G.stackSpil,isFree,&sloc, sym)) {
we need to allocate this on the stack : this is really a
hack!! but cannot think of anything better at this time */
- sprintf(buffer,"sloc%d",_G.slocNum++);
- sloc = newiTemp(buffer);
+ if (sprintf(slocBuffer,"sloc%d",_G.slocNum++) >= sizeof(slocBuffer))
+ {
+ fprintf(stderr, "***Internal error: slocBuffer overflowed: %s:%d\n",
+ __FILE__, __LINE__);
+ exit(1);
+ }
+
+ sloc = newiTemp(slocBuffer);
/* set the type to the spilling symbol */
sloc->type = copyLinkChain(sym->type);
--- /dev/null
+PRJDIR = ../..
+
+# !include $(PRJDIR)/Makefile.common
+
+OBJ = gen.obj ralloc.obj main.obj gbz80.obj
+LIB = port.lib
+
+CFLAGS = -6 -O -g0 -I.. -I. -I..\.. -I..\..\support
+
+.c.obj:
+ BCC32 -c $(CFLAGS) $(CPPFLAGS) $<
+
+all: $(LIB)
+
+main.obj: main.c peeph.rul
+gbz80.obj: gbz80.c peeph-gbz80.rul
+
+$(LIB): peeph.rul $(OBJ)
+ del $(LIB)
+ tlib /a $(LIB) +gen.obj +ralloc.obj +main.obj +gbz80.obj
+
+peeph.rul: peeph.def
+ gawk -f ../SDCCpeeph.awk peeph.def > peeph.rul
+
+peeph-gbz80.rul: peeph-gbz80.def
+ gawk -f ../SDCCpeeph.awk peeph-gbz80.def > peeph-gbz80.rul
+
+# include clean.mk