get Borland makefiles working yet again
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 May 2001 06:20:33 +0000 (06:20 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 May 2001 06:20:33 +0000 (06:20 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@822 4a8a32a2-be11-0410-ad9d-d568d2c75423

17 files changed:
Bcc.inc
Makefile.bcc
src/Makefile.bcc
src/SDCCcse.c
src/SDCCset.h
src/avr/Makefile.bcc
src/ds390/gen.c
src/izt/Makefile.bcc [new file with mode: 0644]
src/izt/gen.c
src/izt/i186.c
src/izt/tlcs900h.c
src/mcs51/gen.c
src/pic/Makefile.bcc
src/pic/pcode.c
src/pic/pcodepeep.c
support/cpp/Makefile.bcc
support/gc/BCC_MAKEFILE

diff --git a/Bcc.inc b/Bcc.inc
index 68c872d8074cd67c20bee55293d8b280bf53b288..29b4d079cf04316016b206dc92a6ff8e10de6be7 100644 (file)
--- a/Bcc.inc
+++ b/Bcc.inc
@@ -1,6 +1,8 @@
 #Generic rules and options for building with Borland C++
 
+SLIB = $(PRJDIR)/support/Util
+
 OFLAGS = -6 -O2 -g0 -w-proto
 
 .c.obj:
-        BCC32 -c $(OFLAGS) $(CFLAGS) $(CPPFLAGS) $<
+        BCC32 -c -o$@ $(OFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(SLIB) $<
index e3c4ac5f4bf02ebbb23377990642153dea70800e..f79166285d8577294089ce3b41ce1a016887166d 100644 (file)
@@ -15,7 +15,7 @@ gc:
        make -f BCC_MAKEFILE gc.lib
        cd ..\..
 
-ports: z80 mcs51 avr ds390
+ports: z80 mcs51 avr ds390 pic izt
 
 z80:
        cd src\z80
@@ -37,6 +37,16 @@ ds390:
        make -f Makefile.bcc
        cd ..\..
 
+pic:
+       cd src\pic
+       make -f Makefile.bcc
+       cd ..\..
+
+izt:
+        cd src\izt
+       make -f Makefile.bcc
+        cd ..\..
+
 sdcc:
        cd src
        make -f Makefile.bcc
index d64e77290f8fa773dbd8add6fc7e5c3e2fdc3229..ae535aed0ae991f729d1b0bffd6bacf7a5677022 100644 (file)
@@ -1,26 +1,26 @@
-# Generated automatically from Makefile.in by configure.
-#
-#
-#
-
 PRJDIR         = ..
 
 # !include $(PRJDIR)/Makefile.common
 
-PORTS          = mcs51 z80 avr ds390 pic
-PORT_LIBS       = mcs51/port.lib z80/port.lib avr/port.lib ds390/port.lib pic/port.lib
+!include ..\Bcc.inc
+CFLAGS  = -I. -I.. -I..\support
+
+PORTS           = mcs51 z80 avr ds390 pic izt
+PORT_LIBS       = mcs51/port.lib z80/port.lib avr/port.lib ds390/port.lib pic/port.lib izt/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 \
+OBJECTS         = SDCCy.obj SDCClex.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 \
                   asm.obj
 
+SLIBOBJS       = $(SLIB)\SDCCerr.obj $(SLIB)\NewAlloc.obj
+
 TARGET          = $(PRJDIR)/bin/sdcc.exe
 
 # Compiling entire program or any subproject
@@ -28,7 +28,7 @@ TARGET          = $(PRJDIR)/bin/sdcc.exe
 all: $(LIBGC) $(TARGET)
 
 ports:
-#        for i in $(PORTS); do $(MAKE) -C $$i; done
+        for i in $(PORTS); do $(MAKE) -C $$i; done
 
 #$(PRJDIR)/support/gc/libgc.a:
 #        cd $(PRJDIR)/support/gc && $(MAKE)
@@ -40,11 +40,8 @@ ports:
 
 # My rules
 # --------
-$(TARGET): $(OBJECTS) $(PORT_LIBS)
-        bcc32 -e$(TARGET) $(OBJECTS) $(PORT_LIBS) $(LIBGC)
-
-!include ..\Bcc.inc
-CFLAGS  = -I. -I.. -I..\support
+$(TARGET): $(OBJECTS) $(SLIBOBJS) $(PORT_LIBS)
+        bcc32 -e$(TARGET) $(OBJECTS) $(SLIBOBJS) $(PORT_LIBS) $(LIBGC)
 
 SDCCy.h: SDCCy.c
 
index a092c70310abcdf37c29663957992e86ca7ac6b9..5345f49e03cd2c39eb9d17b6105f8d3751f9f2cd 100644 (file)
@@ -1162,9 +1162,9 @@ deleteGetPointers (set ** cseSet, set ** pss, operand * op, eBBlock * ebb)
             iTemp1 = iTemp0 + 8;
             iTemp2 = iTemp1 + 8; */
          if (isinSetWith (compItems, (void*)IC_LEFT (cdp->diCode), 
-                          (void*)isOperandEqual) ||
+                          (insetwithFunc)isOperandEqual) ||
              isinSetWith (compItems, (void*)IC_RIGHT (cdp->diCode), 
-                          (void*)isOperandEqual))
+                          (insetwithFunc)isOperandEqual))
            {
              addSet (&compItems, IC_RESULT (cdp->diCode));
            }
index f5179baae9c8b7a7fa7b1bb6151d0f8953a9defd..533074b79f8aa1642e3ac20a16d1350e3d44cebf 100644 (file)
@@ -60,7 +60,8 @@ void *getSet (set **);
 void deleteSetItem (set **, void *);
 void deleteItemIf (set **, int (*cond) (void *, va_list),...);
 int isinSet (set *, void *);
-int isinSetWith (set *, void *, int (*cfunc) (void *, void *));
+typedef int (* insetwithFunc) (void *, void *);
+int isinSetWith (set *, void *, insetwithFunc cfunc);
 int applyToSet (set * list, int (*somefunc) (void *, va_list),...);
 int applyToSetFTrue (set * list, int (*somefunc) (void *, va_list),...);
 set *unionSets (set *, set *, int);
index bc0ae8975877c2e6b30b5547944e5d76891a849c..4b17a92d6e87baf9e768207bae6bdda19fbbcf13 100644 (file)
@@ -5,10 +5,8 @@ PRJDIR = ../..
 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) $<
+!include ..\..\Bcc.inc
+CFLAGS  = -I.. -I. -I..\.. -I..\..\support
 
 all: $(LIB)
 
index b3fdbe68ad70a360980ed6a3dfea3601b20c8879..ab8b9654eaa925fdfa50aa977915b42ad81f9f83 100644 (file)
@@ -3701,11 +3701,10 @@ genMultOneByte (operand * left,
   symbol *lbl;
   int size=AOP_SIZE(result);
 
-  emitcode (";",__FUNCTION__);
   if (size<1 || size>2) {
     // this should never happen
       fprintf (stderr, "size!=1||2 (%d) in %s at line:%d \n", 
-              AOP_SIZE(result), __FUNCTION__, lineno);
+              AOP_SIZE(result), __FILE__, lineno);
       exit (1);
   }
 
diff --git a/src/izt/Makefile.bcc b/src/izt/Makefile.bcc
new file mode 100644 (file)
index 0000000..d4a2a70
--- /dev/null
@@ -0,0 +1,23 @@
+PRJDIR = ../..
+
+# !include $(PRJDIR)/Makefile.common
+
+OBJ = i186.obj ralloc.obj gen.obj tlcs900h.obj gen_generic.obj aop.obj util.obj
+LIB = port.lib
+
+!include ..\..\Bcc.inc
+CFLAGS  = -I.. -I. -I..\.. -I..\..\support
+
+all: $(LIB)
+
+i186.obj: i186.c i186_mappings.i
+
+$(LIB): $(OBJ)
+       del $(LIB)
+        tlib /a $(LIB) +i186.obj +ralloc.obj +gen.obj +tlcs900h.obj
+        tlib /a $(LIB) +gen_generic.obj +aop.obj +util.obj
+       
+.def.rul:
+        gawk -f ../SDCCpeeph.awk $< > $@
+
+# include clean.mk
index f5b50f5a5eac97c938e774e76bc40944c0914758..01dd25a4808d3beca38e45f4e139a3eeaa6b2849 100644 (file)
@@ -257,10 +257,12 @@ _emitterCompare (const void *p1, const void *p2)
 static bool
 _tryEmittingiCode (hTab * h, iCode * ic)
 {
-  EMITTER key =
-  {ic->op, NULL};
+  EMITTER key; // = {ic->op, NULL}; Borland C chokes on this; initialize below
   EMITTER *found;
 
+  key.op = ic->op;
+  key.emit = NULL;
+
   found = hTabFindByKey (h, ic->op, &key, _emitterCompare);
 
   if (found)
index a12f962861d22e22c372d446da9caaba98607ba7..8da5f08242de94f60a7037bac388097243409489 100644 (file)
@@ -34,6 +34,7 @@ static IZT_PORT _i186_port = {
 static char _defaultRules[] =
 {
        //#include "peeph.rul"
+    ""
 };
 
 /* list of key words used by i186 */
index 8e106a838a01890443199a93618862a6c5f61761..fc259061df7e246571c6577c516e1fa5c6aaf5b9 100644 (file)
@@ -33,6 +33,7 @@ static IZT_PORT _tlcs900h_port =
 static char _defaultRules[] =
 {
     //#include "peeph.rul"
+    ""
 };
 
 static char *_tlcs900h_keywords[] =
index dcdc36ed1ac1e6f7558448cae08a9d7f301e481d..91dfbcc320180506e98d3d34315f330b690167e6 100644 (file)
@@ -3113,7 +3113,7 @@ genMultOneByte (operand * left,
   if (size<1 || size>2) {
     // this should never happen
       fprintf (stderr, "size!=1||2 (%d) in %s at line:%d \n", 
-              AOP_SIZE(result), __FUNCTION__, lineno);
+              AOP_SIZE(result), __FILE__, lineno);
       exit (1);
   }
 
index 4e0e747091b1b47211eee240a8cf888d90c3bb9f..445fa5ffd383cf9d73b3242bdb7291798b2ccc1d 100644 (file)
@@ -2,11 +2,11 @@ PRJDIR = ../..
 
 # !include $(PRJDIR)/Makefile.common
 
-OBJ = gen.obj ralloc.obj main.obj pcode.obj
+OBJ = gen.obj genarith.obj ralloc.obj main.obj glue.obj pcode.obj pcodepeep.obj
 LIB = port.lib
 
 !include ..\..\Bcc.inc
-CFLAGS  = -I.. -I. -I..\.. -I..\..\support
+CFLAGS  = -I.. -I. -I..\.. -I..\..\support -D__FUNCTION__=__FILE__
 
 all: $(LIB)
 
@@ -14,7 +14,8 @@ main.obj: main.c peeph.rul
 
 $(LIB): peeph.rul $(OBJ)
        del $(LIB)
-       tlib /a $(LIB) +gen.obj +ralloc.obj +main.obj
+        tlib /a $(LIB) +gen.obj +genarith.obj +ralloc.obj +main.obj +glue.obj
+        tlib /a $(LIB) +pcode.obj +pcodepeep.obj
 
 peeph.rul: peeph.def
         gawk -f ../SDCCpeeph.awk peeph.def > peeph.rul
index 95188313ab9b9476c95a7d11de6c881cc8239520..9c3e288bf4fb7641925e932e75b6f052cd681cc0 100644 (file)
 
 #include "pcode.h"
 #include "ralloc.h"
+
+#if defined(__BORLANDC__) || defined(_MSC_VER)
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
+
 // Eventually this will go into device dependent files:
 pCodeOpReg pc_status    = {{PO_STATUS,  "STATUS"}, -1, NULL,NULL};
 pCodeOpReg pc_indf      = {{PO_INDF,    "INDF"}, -1, NULL,NULL};
@@ -790,7 +797,7 @@ int getpCode(char *mnem,int dest)
 
   while(pci) {
 
-    if(strcasecmp(pci->mnemonic, mnem) == 0) {
+    if(STRCASECMP(pci->mnemonic, mnem) == 0) {
       if((pci->num_ops <= 1) || (pci->dest == dest))
        return(pci->op);
     }
index 09a10983102985f8765c2100acc8b44ce6056027..bb4a4fe779b94c07fe85ff186d6d6c41b72d17f2 100644 (file)
 #include "pcode.h"
 #include "ralloc.h"
 
+#if defined(__BORLANDC__) || defined(_MSC_VER)
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
 
 pCodeOp *popCopyGPR2Bit(pCodeOpReg *pc, int bitval);
 
@@ -247,7 +252,7 @@ static pCodeOp *cvt_extract_status(char *reg, char *bit)
 {
   int len;
 
-  if(strcasecmp(reg, pc_status.pcop.name))
+  if(STRCASECMP(reg, pc_status.pcop.name))
     return NULL;
 
   len = strlen(bit);
index 66758159d6527c64c14e5b6a80286320596ea529..06ad65fafcdde3c228c4546eb940e6df6308ccbb 100644 (file)
@@ -1,14 +1,9 @@
-# Generated automatically from Makefile.in by configure.
-#
-#
-#
-
 VERSION         = 2.2.0
 VERSIONHI       = 2
 VERSIONLO       = 2
 VERSIONP        = 0
 
-PRJDIR         = ../..
+PRJDIR         = ..\..
 
 srcdir         = .
 prefix         = /cygnus/cygwin-b20/kvigor/
@@ -30,6 +25,8 @@ LDFLAGS               =
 
 OBJECTS         = cppalloc.obj cpperror.obj cppexp.obj cpphash.obj cpplib.obj cppmain.obj
 
+SLIBOBJS       = $(SLIB)\NewAlloc.obj
+
 TARGET          = $(PRJDIR)\bin\sdcpp.exe
 
 
@@ -37,8 +34,8 @@ TARGET          = $(PRJDIR)\bin\sdcpp.exe
 # ------------------------------------------
 all: $(TARGET)
 
-$(TARGET): $(OBJECTS)
-        bcc32 -e$(TARGET) $(OBJECTS)
+$(TARGET): $(SLIBOBJS) $(OBJECTS)
+        bcc32 -e$(TARGET) $(OBJECTS) $(SLIBOBJS)
 
 !include Makefile.dep
 
index dbcdfdf22f6c612a5cf60d036968af789c3fabf0..ad2dfa2423ef5730877be3a1c59f684208df77ef 100644 (file)
@@ -39,7 +39,7 @@ OBJS= $(XXXOBJS:XXX=)
 
 all: gctest.exe cord\de.exe test_cpp.exe
 
-$(OBJS) test.obj: gc_priv.h gc_hdrs.h gc.h gcconfig.h MAKEFILE
+$(OBJS) test.obj: gc_priv.h gc_hdrs.h gc.h gcconfig.h BCC_MAKEFILE
 
 gc.lib: $(OBJS)
     -del gc.lib