xref: /illumos-gate/usr/src/cmd/fs.d/Makefile.fstype (revision 355b4669e025ff377602b6fc7caaf30dbc218371)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	cmd/fs.d/Makefile.fstype
29#	Definitions and targets common to "simple" file system types.
30#
31
32# FSTYPE is name of filesystem type subdirectory to build
33# PROG is a list of filesystem type programs to be installed BOTH in
34#	../etc/fs/$(FSTYPE) and ../usr/lib/fs/$(FSTYPE)
35#	Those installed under etc/fs must be statically linked, while
36#	those installed under usr/lib/fs must be dynamically linked.
37# ETCPROG is a list of filesystem type programs to be installed ONLY in
38#	../etc/fs/$(FSTYPE)
39# LIBPROG is a list of filesystem type programs to be installed ONLY in
40#	../usr/lib/fs/$(FSTYPE)
41# TYPEPROG is a list of filesystem type programs to be installed ONLY in
42#	../usr/lib/$(FSTYPE)	[as with nfs daemons]
43
44# include global command definitions; SRC should be defined in the shell.
45# SRC is needed until RFE 1026993 is implemented.
46include		$(SRC)/cmd/Makefile.cmd
47
48FSCOMMONDIR=	$(SRC)/cmd/fs.d
49FSLIB=		$(FSCOMMONDIR)/fslib.o
50FSLIBSRC=	$(FSLIB:%.o=%.c)
51
52ROOTETCFS=	$(ROOTETC)/fs
53ROOTLIBFS=	$(ROOTLIB)/fs
54FSDIRS=		$(ROOTETCFS) $(ROOTLIBFS)
55ROOTETCFSTYPE=	$(ROOTETCFS)/$(FSTYPE)
56ROOTLIBFSTYPE=	$(ROOTLIBFS)/$(FSTYPE)
57ROOTETCTYPE=	$(ROOTETC)/$(FSTYPE)
58ROOTLIBTYPE=	$(ROOTLIB)/$(FSTYPE)
59ROOTETCFSPROG=	$(PROG:%=$(ROOTETCFSTYPE)/%) $(ETCPROG:%=$(ROOTETCFSTYPE)/%)
60ROOTLIBFSPROG=	$(PROG:%=$(ROOTLIBFSTYPE)/%) $(LIBPROG:%=$(ROOTLIBFSTYPE)/%)
61ROOTTYPEPROG=	$(TYPEPROG:%=$(ROOTLIBTYPE)/%)
62FSTYPEDIRS=	$(FSDIRS:%=%/$(FSTYPE)) $(ROOTETCTYPE) $(ROOTLIBTYPE)
63FSTYPEPROG=	$(ROOTETCFSPROG) $(ROOTLIBFSPROG) $(ROOTTYPEPROG)
64
65$(FSTYPEDIRS) :=	OWNER = root
66$(FSTYPEDIRS) :=	GROUP = sys
67
68CLOBBERFILES +=	$(ETCPROG) $(LIBPROG) $(TYPEPROG)
69
70.KEEP_STATE:
71
72all:		$(PROG) $(ETCPROG) $(LIBPROG) $(TYPEPROG)
73
74# FSDIRS are made by $(SRC)/Targetdirs via rootdirs in $(SRC)/Makefile
75# Some FSTYPE directories are made there also and should not be made here,
76# but it is easier to handle them as a class.  "install" will not remake
77# a directory that already exists.
78
79$(FSTYPEDIRS):
80		$(INS.dir)
81
82$(ROOTETCFSTYPE)/%:	$(ROOTETCFSTYPE) %
83		$(INS.file)
84
85$(ROOTLIBFSTYPE)/%:	$(ROOTLIBFSTYPE) %
86		$(INS.file)
87
88$(ROOTLIBTYPE)/%:	$(ROOTLIBTYPE) %
89		$(INS.file)
90
91$(ROOTETCTYPE)/%:	$(ROOTETCTYPE) %
92		$(INS.file)
93
94# Prevent fslib.o from being build in the sub makefiles.
95$(FSLIB):
96	@:
97
98include		$(SRC)/cmd/Makefile.targ
99
100install:	all $(FSTYPEPROG) $(OTHERINSTALL)
101
102clean:
103
104