##########################################################################
# (C) Copyright 1991 X/Open Company Limited
#
# All rights reserved.  No part of this source code may be reproduced,
# stored in a retrieval system, or transmitted, in any form or by any
# means, electronic, mechanical, photocopying, recording or otherwise,
# except as stated in the end-user licence agreement, without the prior
# permission of the copyright owners.
#
# X/Open and the 'X' symbol are trademarks of X/Open Company Limited in
# the UK and other countries.
#
#	SCCS:	@(#)POSIX.os/dataform/cpio/Makefile	Rel 4.4.1 (06/09/97)
#	PROJECT:	VSX
#	PRODUCT:	POSIX.os/dataform/cpio
#	AUTHOR:		Dave Cater, UniSoft Ltd.
#	DATE CREATED:	Tue Jun  6 16:20:26 BST 1989
#	TARGETS:	T.cpio
#			cpio_su
#			cpio_uids
##########################################################################

CC =	cc
RM =		rm -f
LINT =	lint
LINT1 =		/usr/lib/lint1
PRINTER =	lpr
PRINTFLAGS =	
TET_ROOT =	../../../../..
VSXDIR =	../../../../SRC
SYSINC =	$(VSXDIR)/SYSINC
SYSLIBS =	
LIBVPORT =	$(VSXLIB)/vport.a
TET_EXECUTE =	../../../../TESTROOT

VSXINC =	$(VSXDIR)/INC
VSXLIB =	$(VSXDIR)/LIB
VSXBIN =	$(VSXDIR)/BIN
CHMOG =	$(VSXBIN)/chmog
GENLIB =	$(VSXLIB)/genlib.a
TSETLIB =	$(VSXLIB)/tsetlib.a

# What is installed:

INSTOWN1 =	vsx0
INSTOWN2 =	root
INSTGRP1 =	vsxg0
INSTMODE1 =	755
INSTMODE2 =	4755
INSTDIR =	$(TET_EXECUTE)/tset/POSIX.os/dataform/cpio

# product-wide libraries for ld(1):

LIBS =		$(TSETLIB) $(XNFSLIB) $(GENLIB) \
		$(VSXLIB)/vlib.a $(LIBVPORT) $(APILIB)

DBUG =	
COPTS =	
SDBFLAG =	
DEFINES =	

INCS =		-I$(TETINC) -I$(VSXINC) -I$(SYSINC)
CFLOCAL =
CFLAGS =	$(CFLOCAL) $(INCS) $(DEFINES) $(DBUG) $(COPTS) $(SDBFLAG)
LDFLAGS =	

K_CFILES =	cpio.c cpio1.c cpio2.c cpio3.c cpio4.c
K_OFILES =	cpio.o cpio1.o cpio2.o cpio3.o cpio4.o

K_CFILESUBSU =	cpio_su.c
K_OFILESUBSU =	cpio_su.o

K_CFILESUBSN =	cpio_uids.c cpio4.c
K_OFILESUBSN =	cpio_uids.o cpio4.o

K_CFILESUBSG =	cpio_gid.c
K_OFILESUBSG =	cpio_gid.o

CFILES =	$(K_CFILES) $(K_CFILESUBSU) $(K_CFILESUBSN)

OLDLINT =	TRUE
LINTFLAGS =	$(INCS) $(DEFINES)  -n
LINTLIBS =	$(LXNFS) -lvsx -lvport -lvlib -ltset -lgen  
LINTDRV =	$(VSXDIR)/common/tet_startup/startup.c

# Targets: ---------------------------------------------------------

all_xnfs:	all cpio_gid

all:		T.cpio cpio_su cpio_uids

cpio:		T.cpio cpio_su cpio_uids

T.cpio:		$(K_OFILES) $(TCM) $(VSXLIB)/startup.o $(LIBS)
		$(CC) -o $@ $(K_OFILES) $(TCM) $(VSXLIB)/startup.o $(LIBS) $(SYSLIBS) $(LDFLAGS)
		@echo "	$@ made"

cpio_su:	$(K_OFILESUBSU) $(TCMCHILD) $(LIBS)
		$(CC) -o $@ $(K_OFILESUBSU) $(TCMCHILD) $(LIBS) $(SYSLIBS) $(LDFLAGS)
		@echo "	$@ made"

cpio_uids:	$(K_OFILESUBSN) $(TCMCHILD) $(LIBS)
		$(CC) -o $@ $(K_OFILESUBSN) $(TCMCHILD) $(LIBS) $(SYSLIBS) $(LDFLAGS)
		@echo "	$@ made"

cpio_gid:	$(K_OFILESUBSG) $(TCMCHILD) $(LIBS)
		$(CC) -o $@ $(K_OFILESUBSG) $(TCMCHILD) $(LIBS) $(SYSLIBS) $(LDFLAGS)
		@echo "	$@ made"

INSTALL_xnfs:	INSTALL $(INSTDIR)/cpio_gid

INSTALL:	$(INSTDIR)/T.cpio $(INSTDIR)/cpio_su $(INSTDIR)/cpio_uids

$(INSTDIR)/T.cpio:	T.cpio
		$(CHMOG) $(INSTMODE1) $(INSTOWN1) $(INSTGRP1) -m $? $@

$(INSTDIR)/cpio_su:	cpio_su
		$(CHMOG) $(INSTMODE2) $(INSTOWN2) $(INSTGRP1) -m $? $@

$(INSTDIR)/cpio_uids:	cpio_uids
		$(CHMOG) $(INSTMODE1) $(INSTOWN1) $(INSTGRP1) -m $? $@

$(INSTDIR)/cpio_gid: cpio_gid
		$(CHMOG) $(INSTMODE2) $(INSTOWN2) $(INSTGRP1) -m $? $@

LINT_xnfs:
		$(LINT) $(LINTFLAGS) $(K_CFILES) $(LINTDRV) $(LTCM) $(LINTLIBS)
		$(LINT) $(LINTFLAGS) $(K_CFILESUBSU) $(LTCMC) $(LINTLIBS)
		$(LINT) $(LINTFLAGS) $(K_CFILESUBSN) $(LTCMC) $(LINTLIBS)
		$(LINT) $(LINTFLAGS) $(K_CFILESUBSG) $(LTCMC) $(LINTLIBS)

LINT:
		$(LINT) $(LINTFLAGS) $(K_CFILES) $(LINTDRV) $(LTCM) $(LINTLIBS)
		$(LINT) $(LINTFLAGS) $(K_CFILESUBSU) $(LTCMC) $(LINTLIBS)
		$(LINT) $(LINTFLAGS) $(K_CFILESUBSN) $(LTCMC) $(LINTLIBS)

FORCE_xnfs:	CLOBBER_xnfs all_xnfs

FORCE:		CLOBBER all

PRINT:
		@$(PRINTER) $(PRINTFLAGS) Makefile \
			$(K_CFILES) \
			$(K_CFILESUBSU) \
			$(K_CFILESUBSN) \
			$(K_CFILESUBSG)

CLEAN_xnfs:
		$(RM) $(K_OFILES) $(K_OFILESUBSU) $(K_OFILESUBSN) \
						$(K_OFILESUBSG)

CLEAN:
		$(RM) $(K_OFILES) $(K_OFILESUBSU) $(K_OFILESUBSN)

CLOBBER_xnfs:	CLEAN_xnfs
		$(RM) T.cpio cpio_su cpio_uids \
			$(INSTDIR)/T.cpio \
			$(INSTDIR)/cpio_su \
			$(INSTDIR)/cpio_uids \
			$(INSTDIR)/cpio_gid

CLOBBER:	CLEAN
		$(RM) T.cpio cpio_su cpio_uids \
			$(INSTDIR)/T.cpio \
			$(INSTDIR)/cpio_su \
			$(INSTDIR)/cpio_uids


depend:
	CFLAGS="$(CFLAGS)" CC="$(CC)" $(VSXBIN)/mkdep $(CFILES)

# DO NOT DELETE THIS LINE -- make depend uses it
# DEPENDENCIES MUST END AT END OF FILE
cpio.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/stdio.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio1.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio2.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio3.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/exitcodes.h  \
	../../../../SRC/INC/pathres.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/fcntl.h  \
	../../../../SRC/SYSINC/limits.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio4.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/exitcodes.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/timeout.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/ctype.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/fcntl.h  \
	../../../../SRC/SYSINC/limits.h  \
	../../../../SRC/SYSINC/setjmp.h  \
	../../../../SRC/SYSINC/signal.h  \
	../../../../SRC/SYSINC/stdio.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/sys/wait.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio_su.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/setprv.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/stdio.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio_uids.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/exitcodes.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/setprv.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/stdio.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
cpio4.o:	../../../../SRC/INC/dbug.h  \
	../../../../SRC/INC/exitcodes.h  \
	../../../../SRC/INC/report.h  \
	../../../../SRC/INC/std.h  \
	../../../../SRC/INC/sysdep.h  \
	../../../../SRC/INC/timeout.h  \
	../../../../SRC/INC/xnfs.h  \
	../../../../SRC/SYSINC/ctype.h  \
	../../../../SRC/SYSINC/errno.h  \
	../../../../SRC/SYSINC/fcntl.h  \
	../../../../SRC/SYSINC/limits.h  \
	../../../../SRC/SYSINC/setjmp.h  \
	../../../../SRC/SYSINC/signal.h  \
	../../../../SRC/SYSINC/stdio.h  \
	../../../../SRC/SYSINC/stdlib.h  \
	../../../../SRC/SYSINC/string.h  \
	../../../../SRC/SYSINC/sys/stat.h  \
	../../../../SRC/SYSINC/sys/types.h  \
	../../../../SRC/SYSINC/sys/wait.h  \
	../../../../SRC/SYSINC/unistd.h  \
	./cpiotest.h 
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
