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