Add support for packihx to Borland makefiles
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 17 Oct 2000 04:03:24 +0000 (04:03 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 17 Oct 2000 04:03:24 +0000 (04:03 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@469 4a8a32a2-be11-0410-ad9d-d568d2c75423

Makefile.bcc
packihx/Makefile.bcc [new file with mode: 0644]
packihx/packihx.c

index e7b8cd24509c74530b4ad0162398e783df2cf963..e3c4ac5f4bf02ebbb23377990642153dea70800e 100644 (file)
@@ -1,45 +1,49 @@
-all: as cpp gc ports sdcc
+all: as cpp gc ports sdcc packihx
 
 as:
-        cd as\mcs51
-        make -f Makefile.bcc
-        cd ..\..
+       cd as\mcs51
+       make -f Makefile.bcc
+       cd ..\..
 
 cpp:
-        cd support\cpp
-        make -f Makefile.bcc
-        cd ..\..
+       cd support\cpp
+       make -f Makefile.bcc
+       cd ..\..
 
 gc:
-        cd support\gc
-        make -f BCC_MAKEFILE gc.lib
-        cd ..\..
+       cd support\gc
+       make -f BCC_MAKEFILE gc.lib
+       cd ..\..
 
 ports: z80 mcs51 avr ds390
 
 z80:
-        cd src\z80
-        make -f Makefile.bcc
-        cd ..\..
+       cd src\z80
+       make -f Makefile.bcc
+       cd ..\..
 
 mcs51:
-        cd src\mcs51
-        make -f Makefile.bcc
-        cd ..\..
+       cd src\mcs51
+       make -f Makefile.bcc
+       cd ..\..
 
 avr:
-        cd src\avr
-        make -f Makefile.bcc
-        cd ..\..
+       cd src\avr
+       make -f Makefile.bcc
+       cd ..\..
 
 ds390:
-        cd src\ds390
-        make -f Makefile.bcc
-        cd ..\..
+       cd src\ds390
+       make -f Makefile.bcc
+       cd ..\..
 
 sdcc:
-        cd src
-        make -f Makefile.bcc
-        cd ..
-
+       cd src
+       make -f Makefile.bcc
+       cd ..
+
+packihx:
+       cd packihx
+       make -f Makefile.bcc
+       cd ..
 
diff --git a/packihx/Makefile.bcc b/packihx/Makefile.bcc
new file mode 100644 (file)
index 0000000..4f03b9e
--- /dev/null
@@ -0,0 +1,18 @@
+PRJDIR         = ..
+
+OBJECTS         = packihx.obj
+
+TARGET          = $(PRJDIR)/bin/packihx.exe
+
+# Compiling entire program or any subproject
+# ------------------------------------------
+all: $(TARGET)
+
+
+# My rules
+# --------
+$(TARGET): $(OBJECTS)
+        bcc32 -e$(TARGET) $(OBJECTS)
+
+!include ..\Bcc.inc
+
index 8675f19038ca5a529bc4a762732cc6fcc7d58cd6..08d028e162da3388ff0ded0e770d2bc5732d8f19 100644 (file)
@@ -20,7 +20,7 @@
 typedef struct _Line
 {
     Uint8              len;            /* length of data portion of record. */
-    Uint16             offset;
+    Uint16      offset;
     Uint8              type;
     Uint8              *data;          
     Uint8              checksum;
@@ -98,7 +98,7 @@ Line *readLine(FILE *inFile)
        {
            return NULL;
        }
-       ++lineno;
+        ++lineno;
     
        if (!buffer[0] || buffer[0] == '\r' || buffer[0] == '\n')
        {
@@ -153,7 +153,7 @@ Line *readLine(FILE *inFile)
         return NULL;
     }
     
-    for (i = 0; i < line->len; i++)
+    for (i = 0; i < (unsigned)line->len; i++)
     {
         if (getHexByte(bp, &(line->data[i])))
         {
@@ -175,7 +175,7 @@ Line *readLine(FILE *inFile)
        free(line);
        return NULL;
     }
-    bp += 2;   /* Two digits consumed. */   
+    /* bp += 2; */    /* Two digits consumed. */
         
     return line;
 }
@@ -184,7 +184,7 @@ Line *readLine(FILE *inFile)
 Uint16 lineChecksum(unsigned len, unsigned offset, unsigned type, 
                    const Uint8 *data)
 {
-    Uint16     checksum = 0;
+    Uint16  checksum;
     unsigned   i;
      
     checksum = len + type + (offset >> 8) + 
@@ -300,7 +300,7 @@ int flushPendingData(void)
 int writeLine(Line *line)
 {
     static Uint16 lastExtendedOffset = 0;
-    int                  rc = 0;
+    int       rc;
     
     if (line->type)
     {
@@ -341,7 +341,7 @@ int writeLine(Line *line)
     }
     else
     {
-        if (pendingOffset + pendingLen != line->offset)
+        if (pendingOffset + pendingLen != (unsigned)line->offset)
         {
             /* This line is not contigous with the last one. Dump pending. */
             if (flushPendingData())