From: kvigor Date: Tue, 17 Oct 2000 04:03:24 +0000 (+0000) Subject: Add support for packihx to Borland makefiles X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=b1002dc6031ca9c446997fd4aa5695617bd82fef;hp=ef94810205ba984c8d9e84a422c6bb2efcddf9e7;p=fw%2Fsdcc Add support for packihx to Borland makefiles git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@469 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/Makefile.bcc b/Makefile.bcc index e7b8cd24..e3c4ac5f 100644 --- a/Makefile.bcc +++ b/Makefile.bcc @@ -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 index 00000000..4f03b9e5 --- /dev/null +++ b/packihx/Makefile.bcc @@ -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 + diff --git a/packihx/packihx.c b/packihx/packihx.c index 8675f190..08d028e1 100644 --- a/packihx/packihx.c +++ b/packihx/packihx.c @@ -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())