Commit 6c8e42f1 authored by Mike Hibler's avatar Mike Hibler
Browse files

update tarball-making target

fix up standalone makefiles
have imagezip -v spit out the FSes it supports
parent b645b345
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -8,10 +8,11 @@ SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = os/imagezip
DISTFILES = ext2_fs.h imagehdr.h linux_types.h queue.h \
DISTFILES = global.h imagehdr.h queue.h sliceinfo.h \
imagedump.c imagedump.8 imagezip.c imagezip.8 \
imageunzip.c crc.c imageunzip.8
imageunzip.c crc.c imageunzip.8 \
extfs/*.[hc] fat/*.[hc] ffs/*.[hc] ntfs/*.[hc]
EXPANDCOPYRIGHT = /usr/site/lib/copyright/expand-copyr
WITH_FFS = 1
......@@ -129,7 +130,7 @@ subdir-clean:
imagezip.tar.gz: imagezip.tar
gzip -c imagezip.tar > imagezip.tar.gz
imagezip.tar: Makefile.sa Makefile-linux.sa $(DISTFILES)
imagezip.tar: Makefile.sa Makefile-linux.sa
rm -rf imagezip-dist; mkdir imagezip-dist
(cd $(SRCDIR); tar cf - Makefile.sa Makefile-linux.sa $(DISTFILES)) | \
(cd imagezip-dist; tar xf -)
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -10,21 +10,45 @@
#
BINDIR= /usr/local/bin
#
# Which filesystems to support
#
WITH_EXTFS = 1
WITH_FFS = 1
WITH_FAT = 0
WITH_NTFS = 0 # needs work
PTHREADCFLAGS = -D_THREAD_SAFE -pthread
#PTHREADLIBS = -L/usr/local/lib -llgcc_r
# get 64-bit off_t and pread/pwrite protos
LINUXOPTS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
LINUXOPTS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1
CFLAGS = -Wall -O2 -g -static $(PTHREADCFLAGS) $(LINUXOPTS)
CFLAGS = -Wall -O2 -g -static -I. $(PTHREADCFLAGS) $(LINUXOPTS)
LIBS = -lz $(PTHREADLIBS)
UNZIPCFLAGS = $(CFLAGS) -Wall
UNZIPLIBS = $(LIBS)
ifdef WITH_EXTFS
FSOBJS += extfs/extfs.o
CFLAGS += -DWITH_EXTFS -Iextfs
endif
ifdef WITH_FFS
FSOBJS += ffs/ffs.o
CFLAGS += -DWITH_FFS -Iffs
endif
ifdef WITH_FAT
FSOBJS += fat/fat_fat.o fat/fat_boot.o fat/fat_glue.o
CFLAGS += -DWITH_FAT -Ifat
endif
all: imagezip imageunzip imagedump
imagezip: imagezip.o version.o
$(CC) $(CFLAGS) imagezip.o version.o $(LIBS) -o imagezip
imagezip: imagezip.o version.o $(FSOBJS)
$(CC) $(CFLAGS) imagezip.o version.o $(FSOBJS) $(LIBS) -o imagezip
imageunzip: imageunzip.o crc.o version.o
$(CC) $(CFLAGS) imageunzip.o crc.o version.o $(UNZIPLIBS) -o imageunzip
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -10,6 +10,14 @@
#
BINDIR= /usr/local/bin
#
# Which filesystems to support
#
WITH_EXTFS = 1
WITH_FFS = 1
WITH_FAT = 0
WITH_NTFS = 0 # needs work
.if defined(NOTHREADS)
PTHREADCFLAGS = -DNOTHREADS
PTHREADLIBS =
......@@ -19,15 +27,35 @@ PTHREADCFLAGS = -D_THREAD_SAFE \
PTHREADLIBS = -L/usr/local/lib -llthread -llgcc_r
.endif
CFLAGS = -Wall -O2 -g -static
CFLAGS = -Wall -O2 -g -static -I.
LIBS = -lz $(PTHREADLIBS)
UNZIPCFLAGS = $(CFLAGS) $(PTHREADCFLAGS) -Wall
UNZIPLIBS = $(LIBS) $(PTHREADLIBS)
.ifdef WITH_EXTFS
FSDIRS += extfs
FSOBJS += extfs.o
CFLAGS += -DWITH_EXTFS -Iextfs
.endif
.ifdef WITH_FFS
FSDIRS += ffs
FSOBJS += ffs.o
CFLAGS += -DWITH_FFS -Iffs
.endif
.ifdef WITH_FAT
FSDIRS += fat
FSOBJS += fat_fat.o fat_boot.o fat_glue.o
CFLAGS += -DWITH_FAT -Ifat
.endif
.PATH: $(FSDIRS)
all: imagezip imageunzip imagedump
imagezip: imagezip.o version.o
$(CC) $(CFLAGS) imagezip.o version.o $(LIBS) -o imagezip
imagezip: imagezip.o version.o $(FSOBJS)
$(CC) $(CFLAGS) imagezip.o version.o $(FSOBJS) $(LIBS) -o imagezip
imageunzip: imageunzip.o crc.o version.o
$(CC) $(CFLAGS) imageunzip.o crc.o version.o $(UNZIPLIBS) -o imageunzip
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* Copyright (c) 2000-2004 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -102,8 +102,8 @@ static SLICEMAP_PROCESS_PROTO(read_slice);
struct slicemap fsmap[] = {
{ DOSPTYP_UNUSED, "UNUSED", 0 },
#ifdef WITH_FFS
{ DOSPTYP_386BSD, "FBSD FFS", read_bsdslice },
{ DOSPTYP_OPENBSD, "OBSD FFS", read_bsdslice },
{ DOSPTYP_386BSD, "FreeBSD FFS", read_bsdslice },
{ DOSPTYP_OPENBSD, "OpenBSD FFS", read_bsdslice },
#endif
#ifdef WITH_EXTFS
{ DOSPTYP_LINUX, "Linux EXT", read_linuxslice },
......@@ -387,8 +387,16 @@ main(argc, argv)
if (version || info || debug) {
fprintf(stderr, "%s\n", build_info);
if (version)
if (version) {
fprintf(stderr, "Supports");
for (ch = 1; fsmap[ch].type != -1; ch++)
if (fsmap[ch].process != 0)
fprintf(stderr, "%c %s",
ch > 1 ? ',' : ':',
fsmap[ch].desc);
fprintf(stderr, "\n");
exit(0);
}
}
if (argc < 1 || argc > 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment