Makefile revision cc22b130832529204c03214239a57aaadd05101f
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# CDDL HEADER START
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# The contents of this file are subject to the terms of the
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# Common Development and Distribution License (the "License").
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# You may not use this file except in compliance with the License.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# or http://www.opensolaris.org/os/licensing.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# See the License for the specific language governing permissions
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# and limitations under the License.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# When distributing Covered Code, include this CDDL HEADER in each
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# If applicable, add the following below this CDDL HEADER, with the
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# CDDL HEADER END
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
a66802cd71ae9cdacf0e19c6858ac43ceffada6dvboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# The filesystem independent utilities clri, fsdb, dcopy, labelit, and mkfs
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# are all built from the source file switchout.c. They are all then links
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# to the same object. This is accomplished by:
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# 1) building clri from switchout.c (had to choose one)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# 2) installing it in the target directory
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# 3) linking the others to clri.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# In a similar manner, ncheck is linked to ff.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncDFPROG= df
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPROG= $(DFPROG) fsck volcopy ff
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTFS_PROG= mount umount
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncXPG4PROG= df
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSPPROG= clri
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncMNTTAB= mnttab
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncDEFAULTFILES= fs.dfl
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncinclude ../Makefile.cmd
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSUBDIR1= lofs zfs
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSUBDIR2= dev fd pcfs nfs hsfs proc ctfs udfs ufs tmpfs cachefs \
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync autofs mntfs objfs sharefs smbclnt reparsed
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSUBDIRS= $(SUBDIR1) $(SUBDIR2)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncI18NDIRS= $(SUBDIR2)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncCLOBBERFILES += $(POFILES_XPG4)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncall:= TARGET= all
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncinstall:= TARGET= install
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncclean:= TARGET= clean
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncclobber:= TARGET= clobber
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsynclint:= TARGET= lint
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync_msg:= TARGET= catalog
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncUSRSBINF= df clri fsck volcopy ff
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncUSRSBINCLRI= dcopy fsdb fssnap labelit mkfs
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncUSRSBINFF= ncheck
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncETC2SBIN= mount umount
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncETC2USRSBIN= clri fsdb mkfs fsck labelit dcopy volcopy ff ncheck
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncUSRBIN2USRSBIN= df
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncFSLIB= fslib.o
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTUSRSBINLINKS = $(ROOTFS_PROG:%=$(ROOTUSRSBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTUSRSBINCLRI= $(USRSBINCLRI:%=$(ROOTUSRSBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTUSRSBINFF= $(USRSBINFF:%=$(ROOTUSRSBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncROOTETCMNTTAB= $(MNTTAB:%=$(ROOTETC)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSYMETC2SBIN = $(ETC2SBIN:%=$(ROOTETC)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSYMETC2USRSBIN = $(ETC2USRSBIN:%=$(ROOTETC)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSYMUSRBIN2USRSBIN= $(USRBIN2USRSBIN:%=$(ROOTBIN)/%)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncSYMDEVNM= $(ROOTUSRSBIN)/devnm
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncCPPFLAGS += -D_LARGEFILE64_SOURCE
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync%.xpg4.o := CPPFLAGS += -DXPG4
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync$(SPPROG) := LDLIBS += -lkstat
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync$(ROOTETCMNTTAB) := FILEMODE = 444
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# for messaging catalog
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync#
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPOFILE= fs.d.po
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPOFILES1= $(PROG:%=%.po) $(ROOTFS_PROG:%=%.po) switchout.po fssnapsup.po
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPOFILES2= $(I18NDIRS:%=%/%.po)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPOFILES_XPG4 = df.po.xpg4
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncPOFILES= $(POFILES1) $(POFILES2) $(POFILES_XPG4)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync$(POFILES_XPG4) := CFLAGS += -DXPG4
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncvolcopy.po := XGETFLAGS += -a -x volcopy.xcl
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync$(POFILES_XPG4) := XGETFLAGS += -a -x df.xcl
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync$(DFPROG).po := XGETFLAGS += -a -x df.xcl
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync%.po.xpg4: %.c
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(COMPILE.cpp) $< > $<.i
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(BUILD.po)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# build rule for xpg4 objects
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync%.xpg4.o: %.c
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(COMPILE.c) -o $@ $<
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync.KEEP_STATE:
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# This is too intense when building the whole world.
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync# .PARALLEL: $(SUBDIRS)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncall: $(FSLIB) .WAIT $(SUBDIRS) .WAIT all_local
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync_msg: $(I18NDIRS) $(POFILES1) $(POFILES_XPG4)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(RM) $(POFILE)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync cat $(POFILES) > $(POFILE)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(RM) $(MSGDOMAIN)/$(POFILE)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync cp $(POFILE) $(MSGDOMAIN)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsyncall_local: $(PROG) $(ROOTFS_PROG) $(XPG4PROG) $(SPPROG) $(MNTTAB) \
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync $(DEFAULTFILES)
45eceef4321181709f6d1c56ae3ca270cd1addb7vboxsync
ff volcopy: deffs.o $$(@F).o
$(LINK.c) -o $@ $@.o deffs.o $(LDLIBS)
$(POST_PROCESS)
df df.xpg4: deffs.o $(FSLIB) $$(@F).o
$(LINK.c) -o $@ $@.o deffs.o $(FSLIB) $(LDLIBS)
$(POST_PROCESS)
fsck: fsck.o deffs.o preenlib.o
$(LINK.c) -o $@ fsck.o deffs.o preenlib.o $(LDLIBS)
$(POST_PROCESS)
mount: deffs.o mount.o $(FSLIB)
$(LINK.c) -o $@ mount.o deffs.o $(FSLIB) $(LDLIBS)
$(POST_PROCESS)
umount: umount.o $(FSLIB)
$(LINK.c) -o $@ umount.o $(FSLIB) $(LDLIBS)
$(POST_PROCESS)
$(SPPROG): switchout.o deffs.o fssnapsup.o
$(LINK.c) -o $@ switchout.o deffs.o fssnapsup.o $(LDLIBS) -ldiskmgt
$(POST_PROCESS)
install: $(FSLIB) .WAIT $(SUBDIRS) .WAIT install_local
install_local: all_local $(ROOTSBINPROG) $(ROOTUSRSBINF) $(ROOTUSRSBINCLRI) \
$(ROOTUSRSBINFF) $(ROOTETCMNTTAB) $(ROOTETCDEFAULTFILES) \
$(ROOTXPG4PROG) $(SYMETC2SBIN) $(SYMETC2USRSBIN) \
$(SYMUSRBIN2USRSBIN) $(SYMDEVNM) $(ROOTUSRSBINLINKS)
# Links from /etc to /sbin such as /etc/mount -> ../sbin/mount
$(SYMETC2SBIN):
-$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
# Links from /etc to /usr/sbin such as /etc/clri -> ../usr/sbin/clri
$(SYMETC2USRSBIN):
-$(RM) $@; $(SYMLINK) ../usr/sbin/$(@F) $@
# Links from /usr/bin to /usr/sbin such as /usr/bin/df -> ../sbin/df
$(SYMUSRBIN2USRSBIN):
-$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
# Links from /usr/sbin to /sbin such as /usr/sbin/mount -> ../../sbin/mount
$(ROOTUSRSBINLINKS):
-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
# Symlink from devnm to df in /usr/sbin
$(SYMDEVNM):
-$(RM) $@; $(SYMLINK) ./df $@
# Multiple names for switchout (clri, dcopy, fsdb, labelit, mkfs)
$(ROOTUSRSBINCLRI): $(ROOTUSRSBIN)/clri
-$(RM) $@; $(SYMLINK) ./clri $@
$(MNTTAB):
touch $(MNTTAB)
fs.dfl:
$(RM) $@; $(ECHO) "LOCAL=ufs" >$@
# Multiple names for ff (ncheck)
$(ROOTUSRSBINFF): $(ROOTUSRSBIN)/ff
-$(RM) $@; $(SYMLINK) ./ff $@
clean: $(SUBDIRS) .WAIT clean_local
clean_local:
clobber: $(SUBDIRS) .WAIT clobber_local
clobber_local: clean_local
$(RM) $(PROG) $(ROOTFS_PROG) $(SPPROG) $(MNTTAB) $(DEFAULTFILES) \
$(CLOBBERFILES)
lint:
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET)
FRC: