#
# $Id: Makefile.in,v 1.11 1998/06/02 02:40:36 eric Exp $
#
## Makefile for mkisofs.

#### Start of system configuration section. ####

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

LIBS = @LIBS@

prefix = @prefix@
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin

# Where to put the manual pages.
mandir = $(prefix)/man/man8
# Extension (not including `.') for the manual page filenames.
manext = 8

#### End of system configuration section. ####

CFLAGS=@CFLAGS@ -I.
LDFLAGS=@LDFLAGS@
OBJS=mkisofs.o tree.o write.o hash.o rock.o multi.o \
		joliet.o match.o name.o fnmatch.o eltorito.o \
		getopt.o getopt1.o

World: mkisofs

Makefile: Makefile.in config.status
	CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status

config.status: configure
	$(SHELL) config.status --recheck

configure:  configure.in
	cd $(srcdir) && autoconf

mkisofs: Makefile $(OBJS) 
	$(CC) $(LDFLAGS) -o mkisofs  $(OBJS)

install: mkisofs mkisofs.8
	[ -d $(bindir) ] || mkdir $(bindir)
	[ -d $(mandir) ] || mkdir $(mandir)
	$(INSTALL_PROGRAM) mkisofs $(bindir)/mkisofs
	-$(INSTALL_DATA) $(srcdir)/mkisofs.8 $(mandir)/mkisofs.$(manext)

tree.o: tree.c mkisofs.h iso9660.h exclude.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/tree.c

write.o: write.c mkisofs.h iso9660.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/write.c

hash.o: hash.c mkisofs.h  config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/hash.c

rock.o: rock.c mkisofs.h iso9660.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/rock.c

joliet.o: joliet.c mkisofs.h iso9660.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/joliet.c

match.o: match.c match.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/match.c

fnmatch.o: fnmatch.c fnmatch.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/fnmatch.c

multi.o: multi.c iso9660.h mkisofs.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/multi.c

name.o: name.c iso9660.h mkisofs.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/name.c

mkisofs.o: mkisofs.c iso9660.h mkisofs.h exclude.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/mkisofs.c

eltorito.o: eltorito.c iso9660.h mkisofs.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/eltorito.c

getopt.o: getopt.c exclude.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/getopt.c

getopt1.o: getopt1.c exclude.h config.h Makefile
	$(CC) -c $(CFLAGS) $(srcdir)/getopt1.c

clean:
	/bin/rm -f *.o core mkisofs *~ #*#
	/bin/rm -f config.status config.log config.cache config.h
	(cd diag/; make clean)

#
# All .h files except for config.h get copied.
#
dist:   Makefile
	(mydir=`basename \`pwd\``;\
	cd .. && tar -cvvf - $$mydir/README $$mydir/README.eltorito \
	$$mydir/configure.in $$mydir/configure $$mydir/config.h.in \
	$$mydir/Makefile.in  $$mydir/make.com $$mydir/TODO \
	$$mydir/COPYING $$mydir/ChangeLog $$mydir/*.8 $$mydir/*.c \
	$$mydir/mkisofs.spec $$mydir/acconfig.h \
	$$mydir/install-sh $$mydir/[d-z]*.h \
	$$mydir/cdwrite.c.diff $$mydir/README.session $$mydir/diag/Makefile.in \
	$$mydir/diag/README $$mydir/diag/*.c $$mydir/diag/isoinfo.8 \
	| gzip -9 > $${mydir}.tar.gz)


