Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2009-12-30 13:22:10 (GMT)
committer Daniel Drake <dsd@laptop.org>2009-12-30 13:29:45 (GMT)
commita48d52ab164f2124e2f18057637e5f4345ebce21 (patch)
tree0bf3350a38a90ab502aed78e4de07c540385a384
parentedf7900b26c52dde2a6ecffa496bc53357d65516 (diff)
build tweaks for packaging
-rw-r--r--Makefile1
-rw-r--r--bin/Makefile4
-rw-r--r--bin/zhashfs.c14
3 files changed, 10 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 7fdad01..7cf7ce7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ all: bin
bin:
$(MAKE) -C bin
+.PHONY: bin
install: all
install -D -m 0755 osbuilder.py $(DESTDIR)/usr/sbin/olpc-os-builder
diff --git a/bin/Makefile b/bin/Makefile
index ba202a6..10c7226 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -3,10 +3,10 @@ CC=gcc
all: crcimg zhashfs
crcimg: crc32.c crcimg.c
- $(CC) $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@
zhashfs: zhashfs.c
- $(CC) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DARGTYPE=1 $^ -o $@ -I/usr/include/tomcrypt -ltomcrypt -lz
+ $(CC) $(CFLAGS) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DARGTYPE=1 $^ -o $@ -I/usr/include/tomcrypt -ltomcrypt -lz
install: all
install -D -m 0755 zhashfs $(DESTDIR)/usr/libexec/olpc-os-builder/zhashfs
diff --git a/bin/zhashfs.c b/bin/zhashfs.c
index 7f7bcc0..8561961 100644
--- a/bin/zhashfs.c
+++ b/bin/zhashfs.c
@@ -96,10 +96,10 @@ int main(int argc, char **argv)
++fname;
fprintf(outfile, "data: %s\n", fname);
- fprintf(outfile, "zblocks: %x %x\n", zblocksize, eblocks);
- fprintf(zfile, "zblocks: %x %x\n", zblocksize, eblocks);
+ fprintf(outfile, "zblocks: %lx %lx\n", zblocksize, eblocks);
+ fprintf(zfile, "zblocks: %lx %lx\n", zblocksize, eblocks);
- fprintf(stdout, "Total blocks: %d\n", eblocks);
+ fprintf(stdout, "Total blocks: %ld\n", eblocks);
/* make a hash of the file */
for (i=0; i < eblocks; i++) {
@@ -130,22 +130,22 @@ int main(int argc, char **argv)
zlen = zbufsize;
if ((zresult = compress(zbuf, &zlen, buf, zblocksize)) != Z_OK) {
- fprintf(stderr, "Compress failure at block 0x%x - %d\n", i, zresult);
+ fprintf(stderr, "Compress failure at block 0x%lx - %d\n", i, zresult);
}
- fprintf(outfile, "zblock: %x %x %s ", i, zlen, hashname);
+ fprintf(outfile, "zblock: %lx %lx %s ", i, zlen, hashname);
for(j=0; j<mdlen; j++)
fprintf(outfile,"%02x",md[j]);
fprintf(outfile, "\n");
- fprintf(zfile, "zblock: %x %x %s ", i, zlen, hashname);
+ fprintf(zfile, "zblock: %lx %lx %s ", i, zlen, hashname);
for(j=0; j<mdlen; j++)
fprintf(zfile,"%02x",md[j]);
fprintf(zfile, "\n");
fwrite(zbuf, sizeof(char), zlen, zfile);
fprintf(zfile, "\n");
}
- fprintf(stdout, "\r%d", i); fflush(stdout);
+ fprintf(stdout, "\r%ld", i); fflush(stdout);
}
fprintf(outfile, "zblocks-end:\n");
fprintf(zfile, "zblocks-end:\n");