From: kvigor Date: Wed, 16 May 2001 06:20:33 +0000 (+0000) Subject: get Borland makefiles working yet again X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7899677e61d2e5f44cfb329b8d8326a7a0acdcaa;p=fw%2Fsdcc get Borland makefiles working yet again git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@822 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Bcc.inc b/Bcc.inc index 68c872d8..29b4d079 100644 --- 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) $< diff --git a/Makefile.bcc b/Makefile.bcc index e3c4ac5f..f7916628 100644 --- a/Makefile.bcc +++ b/Makefile.bcc @@ -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 diff --git a/src/Makefile.bcc b/src/Makefile.bcc index d64e7729..ae535aed 100644 --- a/src/Makefile.bcc +++ b/src/Makefile.bcc @@ -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 diff --git a/src/SDCCcse.c b/src/SDCCcse.c index a092c703..5345f49e 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -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)); } diff --git a/src/SDCCset.h b/src/SDCCset.h index f5179baa..533074b7 100644 --- a/src/SDCCset.h +++ b/src/SDCCset.h @@ -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); diff --git a/src/avr/Makefile.bcc b/src/avr/Makefile.bcc index bc0ae897..4b17a92d 100644 --- a/src/avr/Makefile.bcc +++ b/src/avr/Makefile.bcc @@ -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) diff --git a/src/ds390/gen.c b/src/ds390/gen.c index b3fdbe68..ab8b9654 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -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 index 00000000..d4a2a701 --- /dev/null +++ b/src/izt/Makefile.bcc @@ -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 diff --git a/src/izt/gen.c b/src/izt/gen.c index f5b50f5a..01dd25a4 100644 --- a/src/izt/gen.c +++ b/src/izt/gen.c @@ -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) diff --git a/src/izt/i186.c b/src/izt/i186.c index a12f9628..8da5f082 100644 --- a/src/izt/i186.c +++ b/src/izt/i186.c @@ -34,6 +34,7 @@ static IZT_PORT _i186_port = { static char _defaultRules[] = { //#include "peeph.rul" + "" }; /* list of key words used by i186 */ diff --git a/src/izt/tlcs900h.c b/src/izt/tlcs900h.c index 8e106a83..fc259061 100644 --- a/src/izt/tlcs900h.c +++ b/src/izt/tlcs900h.c @@ -33,6 +33,7 @@ static IZT_PORT _tlcs900h_port = static char _defaultRules[] = { //#include "peeph.rul" + "" }; static char *_tlcs900h_keywords[] = diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index dcdc36ed..91dfbcc3 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -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); } diff --git a/src/pic/Makefile.bcc b/src/pic/Makefile.bcc index 4e0e7470..445fa5ff 100644 --- a/src/pic/Makefile.bcc +++ b/src/pic/Makefile.bcc @@ -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 diff --git a/src/pic/pcode.c b/src/pic/pcode.c index 95188313..9c3e288b 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -26,6 +26,13 @@ #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); } diff --git a/src/pic/pcodepeep.c b/src/pic/pcodepeep.c index 09a10983..bb4a4fe7 100644 --- a/src/pic/pcodepeep.c +++ b/src/pic/pcodepeep.c @@ -28,6 +28,11 @@ #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); diff --git a/support/cpp/Makefile.bcc b/support/cpp/Makefile.bcc index 66758159..06ad65fa 100644 --- a/support/cpp/Makefile.bcc +++ b/support/cpp/Makefile.bcc @@ -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 diff --git a/support/gc/BCC_MAKEFILE b/support/gc/BCC_MAKEFILE index dbcdfdf2..ad2dfa24 100644 --- a/support/gc/BCC_MAKEFILE +++ b/support/gc/BCC_MAKEFILE @@ -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