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