xref: /titanic_52/usr/src/cmd/fwflash/Makefile.targ (revision 1f0c339e39c0c782f9d4c4f3f11d373e24e1d76f)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24#
25# cmd/fwflash
26#
27#
28
29include $(SRC)/Makefile.master
30include $(SRC)/cmd/Makefile.cmd
31include $(SRC)/cmd/Makefile.ctf
32
33SRCS=		fwflash.c
34HDRS=		fwflash.h
35
36PROG=		$(SRCS:%.c=%)
37OBJS=		$(SRCS:%.c=%.o)
38LINTFILE=	$(SRCS:%.c=%.ln)
39POFILES=	$(SRCS:%.c=%.po)
40
41POFILE= 	fwflash_msg.po
42
43HDRDIR=../common
44SRCDIR=../common
45
46include ../Makefile.com
47
48ROOTHDRS= $(HDRS:%=$(ROOTUSRINCLDFWFLASH)/%)
49HDRSRCS= $(HDRS:%=$(HDRDIR)/%)
50CHECKHDRS= $(HDRSRCS:%.h=%.check)
51
52$(ROOTUSRSBIN)/$(PROG) :=	FILEMODE = 0555
53$(ROOTUSRINCLDFWFLASH)/%.h :=       FILEMODE = 0644
54
55
56CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
57LDLIBS += -ldevinfo -lumem -lscf
58
59
60$(ROOTUSRINCLDFWFLASH)/%:  $(HDRDIR)/%
61	$(INS.file)
62
63
64$(PROG): install_h $(OBJS)
65	$(LINK.c) -o $(PROG) $(OBJS) $(COMMON_OBJS) $(LDFLAGS) $(LDLIBS)
66	$(POST_PROCESS)
67
68%.o: $(SRCDIR)/%.c
69	$(COMPILE.c) $(CFLAGS) -o $@ $<
70	$(CTFCONVERT_O)
71
72
73all:	$(PROG)
74
75clean:
76	$(RM) $(POFILE) $(POFILES) $(LINTFILE) $(PROG)
77
78clobber: clean
79	$(RM) $(OBJS)
80
81check: $(CHECKHDRS)
82
83install: all $(ROOTUSRSBIN) $(ROOTUSRSBIN)/$(PROG)
84
85install_h:$(ROOTUSRINCLDFWFLASH) $(ROOTHDRS)
86
87lint: $(LINTFILE)
88
89_msg msg:	$(POFILE)
90