xref: /illumos-gate/usr/src/cmd/fs.d/ufs/fsck/Makefile (revision d3b5f56344d8bfcdd6cfb82446af0e5e55ad9ebe)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5948f2876Sss150715# Common Development and Distribution License (the "License").
6948f2876Sss150715# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22948f2876Sss150715# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23355d6bb5Sswilcox# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
255661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateFSTYPE=		ufs
287c478bd9Sstevel@tonic-gateLIBPROG=	fsck
297c478bd9Sstevel@tonic-gateATTMK=		$(LIBPROG)
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude		../../Makefile.fstype
327c478bd9Sstevel@tonic-gateinclude		../Makefile.roll
337c478bd9Sstevel@tonic-gate
34355d6bb5SswilcoxFSCKOBJS=	main.o dir.o dup_avl.o inode.o pass1.o pass1b.o \
35b9a41fd3Sswilcox		pass2.o \
367c478bd9Sstevel@tonic-gate		pass3.o pass3b.o pass4.o pass5.o setup.o \
377c478bd9Sstevel@tonic-gate		utilities.o
387c478bd9Sstevel@tonic-gateFSCKSRCS=	$(FSCKOBJS:%.o=%.c)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateUFSDIR=		../../../../uts/common/fs/ufs
417c478bd9Sstevel@tonic-gateUFSOBJS=	ufs_subr.o ufs_tables.o
42355d6bb5SswilcoxUFSSRCS=	$(UFSOBJS:%.o=$(UFSDIR)/%.c)
437c478bd9Sstevel@tonic-gateROLLDIR=	../roll_log
447c478bd9Sstevel@tonic-gate
45948f2876Sss150715OBJS=		$(FSCKOBJS) $(UFSOBJS) $(ROLLOBJS) $(FSLIB)
46948f2876Sss150715SRCS=		$(FSCKSRCS) $(UFSSRCS) $(ROLLSRCS) $(FSLIBSRC)
47355d6bb5Sswilcox
48355d6bb5SswilcoxCPPFLAGS +=	-D_LARGEFILE64_SOURCE -I../../ -I../../../../lib/libadm/inc
49948f2876Sss150715LDLIBS +=	-lefi -lavl
50355d6bb5Sswilcox
517014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
527014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-implicit-function-declaration
53*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
547014882cSRichard Lowe
555661bb76SJohn Levon# not linted
565661bb76SJohn LevonSMATCH=off
575661bb76SJohn Levon
587c478bd9Sstevel@tonic-gate$(LIBPROG):	$(OBJS)
59355d6bb5Sswilcox		$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
607c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gate%.o:	$(UFSDIR)/%.c
63355d6bb5Sswilcox	$(COMPILE.c) $< $(CTFCONVERT_HOOK)
64355d6bb5Sswilcox
65355d6bb5Sswilcox# Use DEVLINTFLAGS and the definition of LINT.c below for development
66355d6bb5Sswilcox# checking.  Prior to putback, increase Nlevel to 4 for extra sanity.
67355d6bb5Sswilcox# Nlevel=2 is the default applied by lint.
68355d6bb5Sswilcox#
69355d6bb5Sswilcox# Remember to comment LINT.c out before doing the putback, as we shouldn't
70355d6bb5Sswilcox# be overriding the top-level settings under normal circumstances.
71355d6bb5Sswilcox#
72355d6bb5Sswilcox# Note that you have to have a proto area with populated usr/include and
73355d6bb5Sswilcox# usr/include/sys (or the parent workspace needs it).  Otherwise lint gets
74355d6bb5Sswilcox# very confused.  Unfortunately, we also have to tell it where its own
75355d6bb5Sswilcox# include directory is, or it gets the wrong version of note.h.
76355d6bb5Sswilcox
77355d6bb5SswilcoxSECLEVEL=core
78355d6bb5SswilcoxDEVLINTFLAGS =	-errtags=yes -U__PRAGMA_REDEFINE_EXTNAME \
79355d6bb5Sswilcox		$(C99LMODE) -errsecurity=$(SECLEVEL) \
80355d6bb5Sswilcox		-x -Nlevel=2 \
81355d6bb5Sswilcox		-I/net/tools-sparc/export/tools.sparc/on10-tools/SUNWspro/SOS8/prod/include/lint
82355d6bb5Sswilcox
83355d6bb5Sswilcox#LINT.c=		$(LINT) $(DEVLINTFLAGS) $(CPPFLAGS)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gatelint:	lint_SRCS
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gateclean:
88948f2876Sss150715	$(RM) $(FSCKOBJS) $(UFSOBJS)
89355d6bb5Sswilcox
90355d6bb5Sswilcoxcscope.out tags: FRC
91355d6bb5Sswilcox	$(XREF) -f -x $@
92355d6bb5Sswilcox
93355d6bb5SswilcoxFRC:
94