xref: /illumos-gate/usr/src/psm/stand/cpr/common/Makefile.com (revision 814a60b13c0ad90e5d2edfd29a7a84bbf416cc1a)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# psm/stand/cpr/common/Makefile.com
29#
30GREP	=	egrep
31WC	=	wc
32TOPDIR	=	../../../../..
33
34include $(TOPDIR)/Makefile.master
35include $(TOPDIR)/Makefile.psm
36include $(TOPDIR)/psm/stand/lib/Makefile.lib
37
38SYSDIR	=  	$(TOPDIR)/uts
39COMDIR	=  	../../common
40OSDIR  =	$(SYSDIR)/common/os
41ARCHDIR	= 	$(SYSDIR)/$(ARCH)
42MACHDIR	= 	$(SYSDIR)/$(MACH)
43MMUDIR	=	$(SYSDIR)/$(MMU)
44PROMLIBDIR=	$(TOPDIR)/psm/stand/lib/promif/$(ARCH_PROMDIR)
45PROMLIB	=	$(PROMLIBDIR)/libprom.a
46
47SALIBS +=	$(PROMLIB)
48LDLIBS +=	-L$(PROMLIBDIR) -lprom
49LDFLAGS =	-dn -M mapfile $(MAP_FLAG)
50
51LINTLIBS +=	$(PROMLIBDIR)/llib-lprom.ln
52LINTFLAGS.lib =	-ysxmun
53
54CPRBOOTOBJ +=	support.o compress.o
55
56L_SRCS	=	$(COMDIR)/support.c $(OSDIR)/compress.c
57L_COBJ	=	$(CPRBOOTOBJ:%.o=%.ln)
58
59CPPDEFS =	$(ARCHOPTS) -D$(ARCH) -D__$(ARCH) -D$(MACH) -D__$(MACH)
60CPPDEFS +=	-D_KERNEL -D_MACHDEP -D__ELF
61
62CPPINCS =	-I. -I$(ARCHDIR) -I$(MMUDIR) -I$(MACHDIR)
63CPPINCS +=	-I$(MACHDIR)/$(ARCHVER)	-I$(SYSDIR)/sun
64CPPINCS +=	-I$(SYSDIR)/sun4 -I$(SYSDIR)/common -I$(TOPDIR)/head
65
66CPPFLAGS =	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
67CPPFLAGS +=	$(CCYFLAG)$(SYSDIR)/common
68
69CFLAGS =	$(CCVERBOSE) -O
70
71ASFLAGS = 	-P -D_ASM $(CPPDEFS) -DLOCORE -D_LOCORE -D__STDC__
72AS_CPPFLAGS =	$(CPPINCS) $(CPPFLAGS.master)
73
74# install values
75CPRFILES=	$(ALL:%=$(ROOT_PSM_DIR)/$(ARCH)/%)
76FILEMODE=	644
77OWNER=		root
78GROUP=		sys
79
80# lint stuff
81LINTFLAGS += -Dlint
82LOPTS = -hbxn
83
84# install rule
85$(ROOT_PSM_DIR)/$(ARCH)/%: %
86	$(INS.file)
87
88
89all:	$(ALL)
90
91install: all $(CPRFILES)
92
93
94LINT.c=	$(LINT) $(LINTFLAGS.c) $(LINT_DEFS) $(CPPFLAGS) -c
95LINT.s=	$(LINT) $(LINTFLAGS.s) $(LINT_DEFS) $(CPPFLAGS) -c
96
97# build rule
98
99compress.o: $(OSDIR)/compress.c
100	$(COMPILE.c) $(OSDIR)/compress.c
101
102support.o: $(COMDIR)/support.c
103	$(COMPILE.c) $(COMDIR)/support.c
104
105compress.ln: $(OSDIR)/compress.c
106	@$(LHEAD) $(LINT.c) $(OSDIR)/compress.c $(LTAIL)
107
108support.ln: $(COMDIR)/support.c
109	@$(LHEAD) $(LINT.c) $(COMDIR)/support.c $(LTAIL)
110
111%.ln: %.c
112	@$(LHEAD) $(LINT.c) $< $(LTAIL)
113
114%.ln: %.s
115	@$(LHEAD) $(LINT.s) $< $(LTAIL)
116
117.KEEP_STATE:
118
119.PARALLEL:	$(CPRBOOTOBJ) $(L_COBJ)
120
121cprboot: $(CPRBOOT_MAPFILE) $(CPRBOOTOBJ) $(SALIBS)
122	$(LD) $(LDFLAGS) -o $@ $(CPRBOOTOBJ) $(LDLIBS)
123	$(POST_PROCESS)
124
125$(SALIBS): FRC
126	@cd $(@D); $(MAKE) $(MFLAGS)
127
128$(LINTLIBS): FRC
129	@cd $(@D); $(MAKE) $(MFLAGS) $(@F)
130
131$(ROOTDIR):
132	$(INS.dir)
133
134lint: $(L_COBJ) $(LINTLIBS)
135	@$(ECHO) "\n$@: global crosschecks:"
136	@$(LINT.2) $(L_COBJ) $(LDLIBS)
137
138clean.lint:
139	$(RM) *.ln
140
141clean:
142	$(RM) *.o *.ln
143
144clobber:
145	$(RM) *.o *.ln $(ALL)
146
147FRC:
148