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