## -----------------------------------------------------------------------
##   
##   Copyright 2001 H. Peter Anvin - All Rights Reserved
##
##   This program is free software; you can redistribute it and/or modify
##   it under the terms of the GNU General Public License as published by
##   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
##   USA; either version 2 of the License, or (at your option) any later
##   version; incorporated herein by reference.
##
## -----------------------------------------------------------------------

##
## Makefile for mkzftree
##
## mkzftree mirrors a tree in a form suitable for "mkisofs -z".
##

-include MCONFIG
include MRULES

OBJS = 	mkzftree.o walk.o workers.o util.o hash.o iso9660.o \
	compress.o uncompress.o

all: mkzftree

clean:
	rm -f *.o *.i *.s version.h mkzftree

distclean: clean
	rm -f MCONFIG config.status config.cache config.log config.h *~ \#*
	rm -f core *.orig *.rej

mkzftree: $(OBJS)
	$(CC) $(LDFLAGS) -o mkzftree $(OBJS) $(LIBS)

spotless: distclean
	rm -f configure

config:	MCONFIG

MCONFIG: configure MCONFIG.in config.h.in
	./configure

config.h: MCONFIG
	: Generated by side effect

configure: configure.in aclocal.m4
	autoconf
	rm -f MCONFIG config.cache config.log config.status config.h

#
# Version header
#
VERSION = $(shell cat version)

version.h: version
	echo "#define ZISOFS_TOOLS_VERSION \"$(VERSION)\"" > version.h

#
# Dependencies
#
mkzftree.o:	mkzftree.c mkzftree.h config.h version.h
workers.o:	workers.c mkzftree.h config.h
compress.o:	compress.c mkzftree.h config.h iso9660.h
hash.o:		hash.c mkzftree.h config.h
iso9660.o:	iso9660.c iso9660.h
uncompress.o:	uncompress.c mkzftree.h config.h iso9660.h
util.o:		util.c mkzftree.h config.h
walk.o:		walk.c mkzftree.h config.h
workers.o:	workers.c mkzftree.h config.h
