head	1.13;
access;
symbols;
locks; strict;
comment	@# @;


1.13
date	2000.07.26.17.23.38;	author kabe;	state Exp;
branches;
next	1.12;

1.12
date	2000.07.26.17.18.22;	author kabe;	state Exp;
branches;
next	1.11;

1.11
date	2000.07.26.17.01.58;	author kabe;	state Exp;
branches;
next	1.10;

1.10
date	2000.07.24.23.29.49;	author kabe;	state Exp;
branches;
next	1.9;

1.9
date	2000.07.24.23.24.02;	author kabe;	state Exp;
branches;
next	1.8;

1.8
date	2000.07.24.22.19.29;	author kabe;	state Exp;
branches;
next	1.7;

1.7
date	2000.07.24.22.10.42;	author kabe;	state Exp;
branches;
next	1.6;

1.6
date	2000.07.24.21.21.27;	author kabe;	state Exp;
branches;
next	1.5;

1.5
date	2000.07.24.20.28.00;	author kabe;	state Exp;
branches;
next	1.4;

1.4
date	2000.02.09.00.50.12;	author kabe;	state Exp;
branches;
next	1.3;

1.3
date	2000.02.08.20.53.30;	author kabe;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.08.18.27.58;	author kabe;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.29.04.18.11;	author kabe;	state Exp;
branches;
next	;


desc
@Makefile for vold_pcfs
@


1.13
log
@ignore output of pkgtest
@
text
@#
#
# $Id: Makefile,v 1.12 2000-07-27 02:18:22+09 kabe Exp kabe $
#

all:
	@@echo "Select 'make method1' 'make method2' or 'make method3'."
install:
	@@echo "Select 'make install-method1' 'make install-method2' or 'make install-method3'."

#
# Targets:
#	install-method1		Installation of Method 1.
#	install-method2		Installation of Method 2.
#	install-method3		Installation of Method 3.
#	uninstall		Uninstall.
#	install-fstyp		Install "fstyp" module for fdiskfs.
#	install-fdiskize	Install "fdiskize" tool.
#
# The Recommended is to "make install-method3 install-fstyp install-fdiskize"
#


CC = gcc
PICFLAGS = -fpic
STDFLAGS= -g -O
BINDIR = /usr/local/bin

RM = rm -f
RMDIR = rm -fr
INSTALL = /usr/ucb/install
BINUSR = bin
BINGRP = bin
INSTPGMFLAGS  = -s -m 0755
INSTSPGMFLAGS = -s -m 0755 -o $(BINUSR) -g $(BINGRP)
INSTSLIBFLAGS = -m 0755 -o $(BINUSR) -g $(BINGRP)
LD = ld
SHAREDLDFLAGS = -G -z text

METHOD1_TARGET = m1_pcfs_mount
METHOD2_TARGET = m2_pcfs_mount m2_rmmount
SOFDV=1
SOPCV=1
METHOD3_TARGET = ident_fdiskfs.so.$(SOFDV) ident_pcfs.so.$(SOPCV) m3_fdiskfs_mount m2_rmmount

CFLAGS = -DSVX=\"$(SVX)\" $(STDFLAGS)

LIBPCFS = /usr/lib/fs/pcfs
MOUNT   = $(LIBPCFS)/mount
RMMOUNT = /usr/sbin/rmmount
SVX = .dist
IDENT_PCFS = $(LIBPCFS)/ident_pcfs.so.1
LIBFDISKFS = /usr/lib/fs/fdiskfs

PKG=VEGAmtpcv
VERSION=2.0
PKGDIR=pkg.m3
# If you want to build the package on device directly, change this
PKGDEV=$(PKGDIR)/pkgdev

PASSSUBDIR=SOFDV=$(SOFDV) SOPCV=$(SOPCV) SVX=$(SVX) BINDIR=$(BINDIR)


method1: $(METHOD1_TARGET)

install-method1: $(METHOD1_TARGET)
	test -x $(DESTDIR)$(MOUNT)$(SVX) || mv $(DESTDIR)$(MOUNT) $(DESTDIR)$(MOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m1_pcfs_mount $(DESTDIR)$(MOUNT)


method2: $(METHOD2_TARGET)

install-method2: $(METHOD2_TARGET)
	test -x $(DESTDIR)$(MOUNT)$(SVX) || mv $(DESTDIR)$(MOUNT) $(DESTDIR)$(MOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_pcfs_mount $(DESTDIR)$(MOUNT)
	test -x $(DESTDIR)$(RMMOUNT)$(SVX) || mv $(DESTDIR)$(RMMOUNT) $(DESTDIR)$(RMMOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_rmmount $(DESTDIR)$(RMMOUNT)


method3: $(METHOD3_TARGET)

ident_fdiskfs.so.$(SOFDV): m3_ident_fdiskfs.o
	$(LD) -o $@@ $(SHAREDLDFLAGS) m3_ident_fdiskfs.o

ident_pcfs.so.$(SOPCV): m3_ident_pcfs.o
	$(LD) -o $@@ $(SHAREDLDFLAGS) m3_ident_pcfs.o

m3_ident_fdiskfs.o: m3_ident_fdiskfs.c
	$(CC) -c $(CFLAGS) $(PICFLAGS) $*.c

m3_ident_pcfs.o: m3_ident_pcfs.c
	$(CC) -c $(CFLAGS) $(PICFLAGS) $*.c

m3_fdiskfs_mount: m2_pcfs_mount.c
	$(CC) -o $@@ -DSVX=\"\" -DALWAYS_ADD_C $(STDFLAGS)  m2_pcfs_mount.c
	
install-method3: $(METHOD3_TARGET)
	if test ! -d $(DESTDIR)$(LIBFDISKFS); then \
		mkdir $(DESTDIR)$(LIBFDISKFS); \
	fi
	$(INSTALL) $(INSTSLIBFLAGS) ident_fdiskfs.so.$(SOFDV) $(DESTDIR)$(LIBFDISKFS)
	$(INSTALL) $(INSTSPGMFLAGS) m3_fdiskfs_mount $(DESTDIR)$(LIBFDISKFS)/mount
	test -f $(DESTDIR)$(IDENT_PCFS)$(SVX) || mv $(DESTDIR)$(IDENT_PCFS) $(DESTDIR)$(IDENT_PCFS)$(SVX)
	$(INSTALL) $(INSTSLIBFLAGS) ident_pcfs.so.$(SOPCV) $(DESTDIR)$(IDENT_PCFS)
	test -x $(DESTDIR)$(RMMOUNT)$(SVX) || mv $(DESTDIR)$(RMMOUNT) $(DESTDIR)$(RMMOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_rmmount $(DESTDIR)$(RMMOUNT)
	@@$(MAKE) postinst-message

postinst-message:
	@@echo ================
	@@echo Now add the following to /etc/rmmount.conf:
	@@echo "	ident fdiskfs ident_fdiskfs.so rmscsi"
	@@grep -s 'ident_fdiskfs.so' $(DESTDIR)/etc/rmmount.conf >/dev/null && echo '	(you already have it)'
	@@echo and follwing to /etc/vold.conf:
	@@echo "	unsafe ufs hsfs pcfs fdiskfs"
	@@grep -s 'unsafe .*fdiskfs' $(DESTDIR)/etc/vold.conf >/dev/null && echo '	(you already have it)'
	@@echo ================


uninstall::
	-test -x $(DESTDIR)$(MOUNT)$(SVX)   && mv $(DESTDIR)$(MOUNT)$(SVX) $(DESTDIR)$(MOUNT)
	-test -x $(DESTDIR)$(RMMOUNT)$(SVX) && mv $(DESTDIR)$(RMMOUNT)$(SVX) $(DESTDIR)$(RMMOUNT)
	-test -f $(DESTDIR)$(IDENT_PCFS)$(SVX) && mv $(DESTDIR)$(IDENT_PCFS)$(SVX) $(DESTDIR)$(IDENT_PCFS)
	-test -d $(DESTDIR)$(LIBFDISKFS)    && rm -fr $(DESTDIR)$(LIBFDISKFS)

clean::
	$(RM) core a.out *.o *~
	$(RM) m1_pcfs_mount m2_pcfs_mount m2_rmmount
	$(RM) ident_fdiskfs.so.$(SOFDV) ident_pcfs.so.$(SOPCV)
	$(RM) m3_fdiskfs_mount


fstyp: fstyp_pcfs fstyp_fdiskfs

fstyp_pcfs: fstyp.o m3_ident_pcfs.o
	$(CC) -o $@@ fstyp.o m3_ident_pcfs.o

fstyp_fdiskfs: fstyp.o m3_ident_fdiskfs.o
	$(CC) -o $@@ fstyp.o m3_ident_fdiskfs.o

install-fstyp: fstyp_pcfs fstyp_fdiskfs
	test -x $(DESTDIR)$(LIBPCFS)/fstyp$(SVX) || mv $(DESTDIR)$(LIBPCFS)/fstyp $(DESTDIR)$(LIBPCFS)/fstyp$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) fstyp_pcfs $(DESTDIR)$(LIBPCFS)/fstyp
	$(INSTALL) $(INSTSPGMFLAGS) fstyp_fdiskfs $(DESTDIR)$(LIBFDISKFS)/fstyp

uninstall::
	-test -x $(DESTDIR)$(LIBPCFS)/fstyp$(SVX) && mv $(DESTDIR)$(LIBPCFS)/fstyp$(SVX) $(DESTDIR)$(LIBPCFS)/fstyp

clean::
	$(RM) fstyp_pcfs fstyp_fdiskfs


fdiskize: fdiskize.c
	$(CC) -o $@@ $(STDFLAGS) fdiskize.c
install-fdiskize: fdiskize
	test ! -d $(BINDIR) && mkdir $(BINDIR)
	$(INSTALL) $(INSTPGMFLAGS) fdiskize $(DESTDIR)$(BINDIR)
clean::
	$(RM) fdiskize


archive:
	PWD=`pwd`; D=`basename $$PWD`; \
	cd ..; tar --exclude='*,v' -cf - $$D | gzip -9 > $$D-$(VERSION).tar.gz

all+: method1 method2 method3 fstyp fdiskize

##-------------------------------

pkg: method3 fdiskize fstyp
	cd pkg.m3; $(MAKE) $(PASSSUBDIR) TOPDIR=.. $@@
	@@$(MAKE) postinst-message

pkgtest:
	cd pkg.m3; $(MAKE) $(PASSSUBDIR) TOPDIR=.. $@@

clean::
	cd pkg.m3; $(MAKE) $(PASSSUBDIR) $@@
@


1.12
log
@moved out pkg things to pkg.m3/Makefile
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.11 2000-07-27 02:01:58+09 kabe Exp kabe $
d173 3
@


1.11
log
@change tar name
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.10 2000-07-25 08:29:49+09 kabe Exp kabe $
d61 3
d170 2
a171 9
pkg: method3 fstyp fdiskize $(PKGDEV)/pkgmap

## create package in $(PKGDEV)
$(PKGDEV)/pkgmap: $(PKGDIR)/pkginfo $(PKGDIR)/prototype $(PKGDIR)/depend $(PKGDIR)/postinstall $(PKGDIR)/postremove
	@@# creates pkgdev/$(PKG)/
	test -d $(PKGDEV) || mkdir $(PKGDEV)
	pkgmk -o -d $(PKGDEV) -f $(PKGDIR)/prototype build=..
	@@echo ================
	@@echo "Now test the package by \"make pkgtest\", or install it by \"pkgadd -d $(PKGDEV)\"."
a173 16
$(PKGDIR)/pkginfo $(PKGDIR)/prototype $(PKGDIR)/depend $(PKGDIR)/postinstall $(PKGDIR)/postremove: \
	$(PKGDIR)/pkginfo.in $(PKGDIR)/prototype.in $(PKGDIR)/depend.in $(PKGDIR)/postinstall.in $(PKGDIR)/postremove.in
	sed -e 's/@@PKG@@/$(PKG)/; s/@@VERSION@@/$(VERSION)/; s/@@SOFDV@@/$(SOFDV)/g; s/@@SOPCV@@/$(SOPCV)/g; s/@@SVX@@/$(SVX)/g' -e "s:@@BINDIR@@:"`echo $(BINDIR)|sed -e 's:^/::'`":" $@@.in > $@@
	# touch -r $@@.in $@@
	
clean::
	cd $(PKGDIR); $(RM) pkginfo prototype depend postinstall postremove
	-test -d $(PKGDEV) && $(RMDIR) $(PKGDEV)
pkgtest:
	cd $(PKGDIR);	\
	mkdirhier ROOT/usr/lib/fs/pcfs;	\
	mkdirhier ROOT/usr/sbin;	\
	touch ROOT/usr/lib/fs/pcfs/fstyp;	\
	touch ROOT/usr/lib/fs/pcfs/ident_pcfs.so.1;	\
	touch ROOT/usr/sbin/rmmount;	\
	pkgadd -d pkgdev -R `pwd`/ROOT
d175 1
a175 1
	$(RMDIR) $(PKGDIR)/ROOT
@


1.10
log
@remaining "pkgdev" eliminated
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.9 2000-07-25 08:24:02+09 kabe Exp kabe $
d161 1
a161 1
	cd ..; tar --exclude='*,v' -cf - $$D | gzip -9 > $$D.$(VERSION).tar.gz
@


1.9
log
@supply (/)usr/local/bin to pkginfo from Makefile's BINDIR
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.8 2000-07-25 07:19:29+09 kabe Exp kabe $
d185 1
a185 1
	cd $(PKGDIR); $(RMDIR) pkgdev
d194 2
a195 1

@


1.8
log
@output /etc/{rmmount,vold}.conf twiddle also on "make pkg"
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.7 2000-07-25 07:10:42+09 kabe Exp kabe $
d180 1
a180 1
	sed -e 's/@@PKG@@/$(PKG)/; s/@@VERSION@@/$(VERSION)/; s/@@SOFDV@@/$(SOFDV)/g; s/@@SOPCV@@/$(SOPCV)/g; s/@@SVX@@/$(SVX)/g' $@@.in > $@@
@


1.7
log
@use $(PKGDEV) for package device
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.6 2000-07-25 06:21:27+09 kabe Exp kabe $
d104 3
d174 1
d176 1
@


1.6
log
@add pkg creation rules;
as the pkg things is under $(PKGDIR), it looks ugly.
consider moving the Makefile to PKGDIR...
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.5 2000-07-25 05:28:00+09 kabe Exp kabe $
d58 2
d164 1
a164 1
pkg: method3 fstyp fdiskize pkgdev/$(PKG)/pkgmap
d166 2
a167 2
## create package in $(PKGDIR)/pkgdev/
pkgdev/$(PKG)/pkgmap: $(PKGDIR)/pkginfo $(PKGDIR)/prototype $(PKGDIR)/depend $(PKGDIR)/postinstall $(PKGDIR)/postremove
d169 3
a171 2
	cd $(PKGDIR); test -d pkgdev || mkdir pkgdev
	cd $(PKGDIR); pkgmk -o -d pkgdev build=..
d189 1
@


1.5
log
@add comments at top
,
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.4 2000-02-09 09:50:12+09 kabe Exp kabe $
d30 1
d55 3
a57 1
VERSION=1.0
d160 26
@


1.4
log
@correctly ignore "test &&" result
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.3 2000-02-09 05:53:30+09 kabe Exp kabe $
d10 12
@


1.3
log
@m3_pcfs_mount -> m3_fdiskfs_mount
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.2 2000-02-09 03:27:58+09 kabe Exp kabe $
d98 4
a101 4
	test -x $(DESTDIR)$(MOUNT)$(SVX)   && mv $(DESTDIR)$(MOUNT)$(SVX) $(DESTDIR)$(MOUNT)
	test -x $(DESTDIR)$(RMMOUNT)$(SVX) && mv $(DESTDIR)$(RMMOUNT)$(SVX) $(DESTDIR)$(RMMOUNT)
	test -f $(DESTDIR)$(IDENT_PCFS)$(SVX) && mv $(DESTDIR)$(IDENT_PCFS)$(SVX) $(DESTDIR)$(IDENT_PCFS)
#	test -d $(DESTDIR)$(LIBFDISKFS)    && rm -fr $(DESTDIR)$(LIBFDISKFS)
d124 1
a124 1
	test -x $(DESTDIR)$(LIBPCFS)/fstyp$(SVX) && mv $(DESTDIR)$(LIBPCFS)/fstyp$(SVX) $(DESTDIR)$(LIBPCFS)/fstyp
@


1.2
log
@add $(DESTDIR) for remote client installation
@
text
@d3 1
a3 1
# $Id: Makefile,v 1.1 2000-01-29 13:18:11+09 kabe Exp kabe $
d31 1
a31 1
METHOD3_TARGET = ident_fdiskfs.so.$(SOFDV) ident_pcfs.so.$(SOPCV) m3_pcfs_mount m2_rmmount
d74 1
a74 1
m3_pcfs_mount: m2_pcfs_mount.c
d82 1
a82 1
	$(INSTALL) $(INSTSPGMFLAGS) m3_pcfs_mount $(DESTDIR)$(LIBFDISKFS)/mount
d107 1
a107 1
	$(RM) m3_pcfs_mount
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
# $Id$
d47 2
a48 2
	test -x $(MOUNT)$(SVX) || mv $(MOUNT) $(MOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m1_pcfs_mount $(MOUNT)
d54 4
a57 4
	test -x $(MOUNT)$(SVX) || mv $(MOUNT) $(MOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_pcfs_mount $(MOUNT)
	test -x $(RMMOUNT)$(SVX) || mv $(RMMOUNT) $(RMMOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_rmmount $(RMMOUNT)
d78 2
a79 2
	if test ! -d $(LIBFDISKFS); then \
		mkdir $(LIBFDISKFS); \
d81 6
a86 6
	$(INSTALL) $(INSTSLIBFLAGS) ident_fdiskfs.so.$(SOFDV) $(LIBFDISKFS)
	$(INSTALL) $(INSTSPGMFLAGS) m3_pcfs_mount $(LIBFDISKFS)/mount
	test -f $(IDENT_PCFS)$(SVX) || mv $(IDENT_PCFS) $(IDENT_PCFS)$(SVX)
	$(INSTALL) $(INSTSLIBFLAGS) ident_pcfs.so.$(SOPCV) $(IDENT_PCFS)
	test -x $(RMMOUNT)$(SVX) || mv $(RMMOUNT) $(RMMOUNT)$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) m2_rmmount $(RMMOUNT)
d90 1
a90 1
	@@grep -s 'ident_fdiskfs.so' /etc/rmmount.conf >/dev/null && echo '	(you already have it)'
d93 1
a93 1
	@@grep -s 'unsafe .*fdiskfs' /etc/vold.conf >/dev/null && echo '	(you already have it)'
d98 4
a101 4
	test -x $(MOUNT)$(SVX)   && mv $(MOUNT)$(SVX) $(MOUNT)
	test -x $(RMMOUNT)$(SVX) && mv $(RMMOUNT)$(SVX) $(RMMOUNT)
	test -f $(IDENT_PCFS)$(SVX) && mv $(IDENT_PCFS)$(SVX) $(IDENT_PCFS)
#	test -d $(LIBFDISKFS)    && rm -fr $(LIBFDISKFS)
d119 3
a121 3
	test -x $(LIBPCFS)/fstyp$(SVX) || mv $(LIBPCFS)/fstyp $(LIBPCFS)/fstyp$(SVX)
	$(INSTALL) $(INSTSPGMFLAGS) fstyp_pcfs $(LIBPCFS)/fstyp
	$(INSTALL) $(INSTSPGMFLAGS) fstyp_fdiskfs $(LIBFDISKFS)/fstyp
d124 1
a124 1
	test -x $(LIBPCFS)/fstyp$(SVX) && mv $(LIBPCFS)/fstyp$(SVX) $(LIBPCFS)/fstyp
d134 1
a134 1
	$(INSTALL) $(INSTPGMFLAGS) fdiskize $(BINDIR)
@
