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# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile
27#
28
29# usr/src
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
38CERRWARN	+= -_gcc=-Wno-parentheses
39
40PROMDIR =	$(TOPDIR)/psm/promif/ieee1275/common
41SYSDIR =	$(TOPDIR)/uts
42
43LIBPROM =	libprom.a
44LINTLIBPROM =	llib-lprom.ln
45
46PROM_CFILES =			\
47	prom_2path.c		\
48	prom_boot.c		\
49	prom_devname.c		\
50	prom_devtype.c		\
51	prom_enter.c		\
52	prom_env.c		\
53	prom_exit.c		\
54	prom_fb.c		\
55	prom_getchar.c		\
56	prom_gettime.c		\
57	prom_handler.c		\
58	prom_inpath.c		\
59	prom_interp.c		\
60	prom_io.c		\
61	prom_kbd.c		\
62	prom_key.c		\
63	prom_node.c		\
64	prom_outpath.c		\
65	prom_panic.c		\
66	prom_path.c		\
67	prom_phandle.c		\
68	prom_printf.c		\
69	prom_prop.c		\
70	prom_putchar.c		\
71	prom_reboot.c		\
72	prom_stdin.c		\
73	prom_stdout.c		\
74	prom_string.c		\
75	prom_test.c		\
76	prom_trap.c		\
77	prom_version.c		\
78	prom_wrtestr.c
79
80PROM_SFILES =
81
82PROM_FILES =	$(PROM_CFILES) $(PROM_SFILES)
83
84KARCH =		sun4u
85MMU =		sfmmu
86
87OBJSDIR =	objs
88
89PROM_COBJ =	$(PROM_CFILES:%.c=$(OBJSDIR)/%.o)
90PROM_SOBJ =	$(PROM_SFILES:%.s=$(OBJSDIR)/%.o)
91OBJS =		$(PROM_COBJ) $(PROM_SOBJ)
92L_OBJS =	$(OBJS:%.o=%.ln)
93L_SRCS =	$(PROM_FILES:%=$(PROMDIR)/%)
94
95ARCHOPTS =	-DSTACK_64BIT -Dsun4u
96ASFLAGS =	-D__STDC__ -D_BOOT -D_ASM
97CPPDEFS	=	$(ARCHOPTS) -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
98CPPINCS =	-I. -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) -I$(SYSDIR)/$(MMU) \
99		-I$(SYSDIR)/sparc/v9 -I$(SYSDIR)/sparc \
100		-I$(SYSDIR)/sun -I$(SYSDIR)/common
101CPPFLAGS =	$(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
102CFLAGS +=	$(CCVERBOSE)
103
104.KEEP_STATE:
105
106.PARALLEL:	$(OBJS) $(L_OBJS)
107
108all install: $(LIBPROM)
109
110lint: $(LINTLIBPROM)
111
112clean:
113	$(RM) $(OBJS) $(L_OBJS)
114
115clobber: clean
116	$(RM) $(LIBPROM) $(LINTLIBPROM)
117
118$(LIBPROM): $(OBJSDIR) .WAIT $(OBJS)
119	$(BUILD.AR) $(OBJS)
120
121$(LINTLIBPROM): $(OBJSDIR) .WAIT $(L_OBJS)
122	@$(ECHO) "\nlint library construction:" $@
123	@$(LINT.lib) -o prom $(L_SRCS)
124
125$(OBJSDIR):
126	-@[ -d $@ ] || mkdir $@
127
128#
129# build rules using standard library object subdirectory
130#
131$(OBJSDIR)/%.o: $(PROMDIR)/%.c
132	$(COMPILE.c) -o $@ $<
133	$(POST_PROCESS_O)
134
135$(OBJSDIR)/%.o: $(PROMDIR)/%.s
136	$(COMPILE.s) -o $@ $<
137	$(POST_PROCESS_O)
138
139$(OBJSDIR)/%.ln: $(PROMDIR)/%.c
140	@($(LHEAD) $(LINT.c) $< $(LTAIL))
141	@$(MV) $(@F) $@
142
143$(OBJSDIR)/%.ln: $(PROMDIR)/%.s
144	@($(LHEAD) $(LINT.s) $< $(LTAIL))
145	@$(MV) $(@F) $@
146