xref: /illumos-gate/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile (revision 63c99f9316851ebfab1e6d91ff1807739e55bd5b)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# psm/stand/boot/sparcv9/ieee1275/sun4v/Makefile
26#
27#
28#ident	"%Z%%M%	%I%	%E% SMI"
29#
30TOPDIR =	../../../../../../..
31
32include $(TOPDIR)/Makefile.master
33include $(TOPDIR)/lib/Makefile.lib
34include $(TOPDIR)/psm/stand/lib/Makefile.lib
35include $(TOPDIR)/psm/Makefile.psm.64
36
37CFLAGS64	+= -xchip=ultra $(CCABS32)
38
39PLATDIR =	$(TOPDIR)/psm/promif/ieee1275/sun4u
40PLATSUN4DIR =	$(TOPDIR)/psm/promif/ieee1275/sun4
41SYSDIR =	$(TOPDIR)/uts
42
43LIBPLAT =	libplat.a
44LINTLIBPLAT =	llib-lplat.ln
45
46PLAT_PFILES = 			\
47	prom_heartbeat.c	\
48	prom_mmu.c		\
49	prom_vercheck.c
50
51PLAT_PSUN4FILES =		\
52	prom_alloc.c		\
53	prom_cpuctl.c		\
54	prom_fio.c		\
55	prom_getunum.c		\
56	prom_idprom.c		\
57	prom_init.c		\
58	prom_macaddr.c		\
59	prom_map.c		\
60	prom_mem.c		\
61	prom_retain.c		\
62	prom_sparc.c		\
63	prom_vername.c
64
65KARCH =		sun4v
66MMU =		sfmmu
67
68OBJSDIR =	objs
69
70PLAT_POBJ =	$(PLAT_PFILES:%.c=$(OBJSDIR)/%.o)
71PLAT_PSUN4OBJ =	$(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o)
72OBJS =		$(PLAT_POBJ) $(PLAT_PSUN4OBJ)
73L_OBJS =	$(OBJS:%.o=%.ln)
74L_SRCS = 	$(PLAT_PFILES:%=$(PLATDIR)/%)
75L_SRCS += 	$(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%)
76
77ARCHOPTS=	-Dsun4v
78ASFLAGS =	-P -D__STDC__ -D_BOOT -D_ASM
79CPPDEFS	=	$(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
80CPPINCS =	-I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \
81		-I$(SYSDIR)/sun4u \
82		-I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \
83		-I$(SYSDIR)/sun -I$(SYSDIR)/common
84CPPFLAGS=	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
85CFLAGS +=	$(CCVERBOSE)
86
87.KEEP_STATE:
88
89.PARALLEL:	$(OBJS) $(L_OBJS)
90
91all install: $(LIBPLAT)
92
93lint: $(LINTLIBPLAT)
94
95clean:
96	$(RM) $(OBJS) $(L_OBJS)
97
98clobber: clean
99	$(RM) $(LIBPLAT) $(LINTLIBPLAT) a.out core
100
101$(LIBPLAT): $(OBJSDIR) .WAIT $(OBJS)
102	$(BUILD.AR) $(OBJS)
103
104$(LINTLIBPLAT): $(OBJSDIR) .WAIT $(L_OBJS)
105	@$(ECHO) "\nlint library construction:" $@
106	@$(LINT.lib) -o plat $(L_SRCS)
107
108$(OBJSDIR):
109	-@[ -d $@ ] || mkdir $@
110
111#
112# build rules using standard library object subdirectory
113#
114$(OBJSDIR)/%.o: $(PLATDIR)/%.c
115	$(COMPILE.c) -o $@ $<
116	$(POST_PROCESS_O)
117
118$(OBJSDIR)/%.o: $(PLATDIR)/%.s
119	$(COMPILE.s) -o $@ $<
120	$(POST_PROCESS_O)
121
122$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.c
123	$(COMPILE.c) -o $@ $<
124	$(POST_PROCESS_O)
125
126$(OBJSDIR)/%.o: $(PLATSUN4DIR)/%.s
127	$(COMPILE.s) -o $@ $<
128	$(POST_PROCESS_O)
129
130$(OBJSDIR)/%.ln: $(PLATDIR)/%.c
131	@($(LHEAD) $(LINT.c) $< $(LTAIL))
132	@$(MV) $(@F) $@
133
134$(OBJSDIR)/%.ln: $(PLATDIR)/%.s
135	@($(LHEAD) $(LINT.s) $< $(LTAIL))
136	@$(MV) $(@F) $@
137
138$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.c
139	@($(LHEAD) $(LINT.c) $< $(LTAIL))
140	@$(MV) $(@F) $@
141
142$(OBJSDIR)/%.ln: $(PLATSUN4DIR)/%.s
143	@($(LHEAD) $(LINT.s) $< $(LTAIL))
144	@$(MV) $(@F) $@
145