xref: /titanic_51/usr/src/psm/stand/cpr/common/Makefile.com (revision ae115bc77f6fcde83175c75b4206dc2e50747966)
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#ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# psm/stand/cpr/common/Makefile.com
28#
29GREP	=	egrep
30WC	=	wc
31TOPDIR	=	../../../../..
32
33include $(TOPDIR)/Makefile.master
34include $(TOPDIR)/Makefile.psm
35include $(TOPDIR)/psm/stand/lib/Makefile.lib
36
37SYSDIR	=  	$(TOPDIR)/uts
38COMDIR	=  	../../common
39OSDIR  =	$(SYSDIR)/common/os
40ARCHDIR	= 	$(SYSDIR)/$(ARCH)
41MACHDIR	= 	$(SYSDIR)/$(MACH)
42MMUDIR	=	$(SYSDIR)/$(MMU)
43PROMLIBDIR=	$(TOPDIR)/psm/stand/lib/promif/$(ARCH_PROMDIR)
44PROMLIB	=	$(PROMLIBDIR)/libprom.a
45
46SALIBS +=	$(PROMLIB)
47LDLIBS +=	-L$(PROMLIBDIR) -lprom
48LDFLAGS =	-dn -M mapfile $(MAP_FLAG)
49
50LINTLIBS +=	$(PROMLIBDIR)/llib-lprom.ln
51LINTFLAGS.lib =	-ysxmun
52
53CPRBOOTOBJ +=	support.o compress.o
54
55L_SRCS	=	$(COMDIR)/support.c $(OSDIR)/compress.c
56L_COBJ	=	$(CPRBOOTOBJ:%.o=%.ln)
57
58CPPDEFS =	$(ARCHOPTS) -D$(ARCH) -D__$(ARCH) -D$(MACH) -D__$(MACH)
59CPPDEFS +=	-D_KERNEL -D_MACHDEP -D__ELF
60
61CPPINCS =	-I. -I$(ARCHDIR) -I$(MMUDIR) -I$(MACHDIR)
62CPPINCS +=	-I$(MACHDIR)/$(ARCHVER)	-I$(SYSDIR)/sun
63CPPINCS +=	-I$(SYSDIR)/sun4 -I$(SYSDIR)/common -I$(TOPDIR)/head
64
65CPPFLAGS =	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
66CPPFLAGS +=	$(CCYFLAG)$(SYSDIR)/common
67
68C99MODE =	$(C99_ENABLE)
69CFLAGS =	$(CCVERBOSE) -O $(C99MODE)
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