xref: /illumos-gate/usr/src/cmd/format/Makefile (revision 33efde4275d24731ef87927237b0ffb0630b6b2d)
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# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
26# Copyright (c) 2018, Joyent, Inc.
27
28PROG= format
29
30COBJS=	add_definition.o analyze.o checkdev.o ctlr_scsi.o \
31	defect.o init_menus.o io.o label.o main.o \
32	menu.o menu_analyze.o menu_cache.o menu_command.o menu_defect.o \
33	menu_partition.o misc.o modify_partition.o partition.o \
34	prompts.o startup.o menu_scsi.o auto_sense.o disk_generic.o \
35	menu_developer.o menu_fdisk.o
36
37OBJS_sparc=   init_csparc.o ctlr_ata.o
38
39OBJS_i386=    init_ci386.o ctlr_ata.o ix_altsctr.o
40
41OBJS_=                non-existent
42
43OBJS=  $(OBJS_$(MACH))  $(COBJS)
44
45DATA= format.dat
46
47include ../Makefile.cmd
48
49CERRWARN += $(CNOWARN_UNINIT)
50CERRWARN += -_gcc=-Wno-parentheses
51CERRWARN += -_gcc=-Wno-clobbered
52
53# not linted
54SMATCH=off
55
56ROOTSYMLINK= $(ROOTETCPROG)
57ROOTETCDATA= $(ROOTETC)/$(DATA)
58
59$(ROOTETCDATA) := FILEMODE = 0644
60
61LDLIBS_i386= -lfdisk
62LDLIBS_sparc=
63LDLIBS +=	-ladm -lefi -ldiskmgt -lnvpair -ldevid -ldevinfo $(LDLIBS_$(MACH))
64
65CPPFLAGS    += -D_EXTVTOC
66
67.KEEP_STATE:
68
69all: $(PROG) $(DATA)
70
71.PARALLEL: $(OBJS)
72
73$(PROG): $(OBJS)
74	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
75	$(POST_PROCESS)
76
77#
78# Install format as /usr/sbin/format, with link from /etc/format
79#
80install: $(ROOTUSRSBINPROG) $(ROOTSYMLINK) $(ROOTETCDATA)
81
82$(ROOTSYMLINK):
83	$(RM) $@; $(SYMLINK) ../usr/sbin/$(PROG) $@
84
85clean:
86	$(RM) $(OBJS)
87
88include ../Makefile.targ
89