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.
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.
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]
21 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
22 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 # The filesystem independent utilities clri, fsdb, dcopy, labelit, and mkfs
26 # are all built from the source file switchout.c. They are all then links
27 # to the same object. This is accomplished by:
28 # 1) building clri from switchout.c (had to choose one)
29 # 2) installing it in the target directory
30 # 3) linking the others to clri.
31 # In a similar manner, ncheck is linked to ff.
34 PROG
= $(DFPROG
) fsck volcopy ff
35 ROOTFS_PROG
= mount umount
40 include ..
/Makefile.cmd
42 SUBDIR1
= bootfs lofs zfs
43 SUBDIR2
= dev fd pcfs nfs hsfs proc ctfs udfs ufs tmpfs \
44 autofs mntfs objfs sharefs smbclnt reparsed
45 SUBDIRS
= $(SUBDIR1
) $(SUBDIR2
)
48 CLEANFILES
+= deffs.o df.o ff.o fsck.o fssnapsup.o \
49 mount.o preenlib.o switchout.o umount.o volcopy.o
52 install:= TARGET
= install
54 clobber:= TARGET
= clobber
55 _msg
:= TARGET
= catalog
57 USRSBINF
= df clri fsck volcopy ff
58 USRSBINCLRI
= dcopy fsdb fssnap labelit mkfs
65 ROOTSBINPROG
= $(ROOTFS_PROG
:%=$(ROOTSBIN
)/%)
66 ROOTUSRSBINLINKS
= $(ROOTFS_PROG
:%=$(ROOTUSRSBIN
)/%)
68 ROOTUSRSBINF
= $(USRSBINF
:%=$(ROOTUSRSBIN
)/%)
69 ROOTUSRSBINCLRI
= $(USRSBINCLRI
:%=$(ROOTUSRSBIN
)/%)
70 ROOTUSRSBINFF
= $(USRSBINFF
:%=$(ROOTUSRSBIN
)/%)
71 ROOTETCMNTTAB
= $(MNTTAB
:%=$(ROOTETC
)/%)
72 SYMUSRBIN2USRSBIN
= $(USRBIN2USRSBIN
:%=$(ROOTBIN
)/%)
73 SYMDEVNM
= $(ROOTUSRSBIN
)/devnm
75 CPPFLAGS
+= -D_LARGEFILE64_SOURCE
77 CERRWARN
+= -Wno-implicit-function-declaration
78 CERRWARN
+= -Wno-parentheses
79 CERRWARN
+= -Wno-unused-variable
80 CERRWARN
+= -Wno-uninitialized
81 CERRWARN
+= -Wno-unused-function
83 $(DFPROG
) := LDLIBS
+= -lcmdutils
84 $(SPPROG
) := LDLIBS
+= -lkstat
86 $(ROOTETCMNTTAB
) := FILEMODE
= 444
88 # for messaging catalog
91 POFILES1
= $(PROG
:%=%.po
) $(ROOTFS_PROG
:%=%.po
) switchout.po fssnapsup.po
92 POFILES2
= $(I18NDIRS
:%=%/%.po
)
93 POFILES
= $(POFILES1
) $(POFILES2
)
94 volcopy.po
:= XGETFLAGS
+= -a
-x volcopy.xcl
95 $(DFPROG
).po
:= XGETFLAGS
+= -a
-x df.xcl
99 # This is too intense when building the whole world.
100 # .PARALLEL: $(SUBDIRS)
102 all: $(FSLIB
) .WAIT
$(SUBDIRS
) .WAIT all_local
104 _msg
: $(I18NDIRS
) $(POFILES1
)
106 cat
$(POFILES
) > $(POFILE
)
107 $(RM
) $(MSGDOMAIN
)/$(POFILE
)
108 cp
$(POFILE
) $(MSGDOMAIN
)
110 all_local
: $(PROG
) $(ROOTFS_PROG
) $(SPPROG
) $(MNTTAB
) \
113 ff volcopy
: deffs.o
$$(@F
).o
114 $(LINK.c
) -o
$@
$@.o deffs.o
$(LDLIBS
)
117 df
: deffs.o
$(FSLIB
) $$(@F
).o
118 $(LINK.c
) -o
$@
$@.o deffs.o
$(FSLIB
) $(LDLIBS
)
121 fsck
: fsck.o deffs.o preenlib.o
122 $(LINK.c
) -o
$@ fsck.o deffs.o preenlib.o
$(LDLIBS
)
125 mount
: deffs.o mount.o
$(FSLIB
)
126 $(LINK.c
) -o
$@ mount.o deffs.o
$(FSLIB
) $(LDLIBS
)
129 umount
: umount.o
$(FSLIB
)
130 $(LINK.c
) -o
$@ umount.o
$(FSLIB
) $(LDLIBS
)
133 $(SPPROG
): switchout.o deffs.o fssnapsup.o
134 $(LINK.c
) -o
$@ switchout.o deffs.o fssnapsup.o
$(LDLIBS
) -ldiskmgt
137 install: $(FSLIB
) .WAIT
$(SUBDIRS
) .WAIT install_local
139 install_local
: all_local
$(ROOTSBINPROG
) $(ROOTUSRSBINF
) $(ROOTUSRSBINCLRI
) \
140 $(ROOTUSRSBINFF
) $(ROOTETCMNTTAB
) $(ROOTETCDEFAULTFILES
) \
141 $(SYMUSRBIN2USRSBIN
) $(SYMDEVNM
) \
144 # Links from /usr/bin to /usr/sbin such as /usr/bin/df -> ../sbin/df
145 $(SYMUSRBIN2USRSBIN
):
146 -$(RM
) $@
; $(SYMLINK
) ..
/sbin
/$(@F
) $@
148 # Links from /usr/sbin to /sbin such as /usr/sbin/mount -> ../../sbin/mount
150 -$(RM
) $@
; $(SYMLINK
) ..
/..
/sbin
/$(@F
) $@
152 # Symlink from devnm to df in /usr/sbin
154 -$(RM
) $@
; $(SYMLINK
) .
/df
$@
156 # Multiple names for switchout (clri, dcopy, fsdb, labelit, mkfs)
157 $(ROOTUSRSBINCLRI
): $(ROOTUSRSBIN
)/clri
158 -$(RM
) $@
; $(SYMLINK
) .
/clri
$@
164 $(RM
) $@
; $(ECHO
) "LOCAL=ufs" >$@
166 # Multiple names for ff (ncheck)
167 $(ROOTUSRSBINFF
): $(ROOTUSRSBIN
)/ff
168 -$(RM
) $@
; $(SYMLINK
) .
/ff
$@
170 clean: $(SUBDIRS
) .WAIT clean_local
174 clobber: $(SUBDIRS
) .WAIT clobber_local
175 clobber_local
: clean_local
176 $(RM
) $(PROG
) $(ROOTFS_PROG
) $(SPPROG
) $(MNTTAB
) $(DEFAULTFILES
) \
181 @cd
$@
; pwd
; $(MAKE
) $(MFLAGS
) $(TARGET
)