Makefile.rules revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# psm/stand/bootblks/obp-c/Makefile.rules
#
OBPSRCDIR = $(BASEDIR)/obp-c
OBPCMNDIR = $(OBPSRCDIR)/common
OBPMACHDIR = $(OBPSRCDIR)/$(MACH)/common
OBPPLATDIR = $(OBPSRCDIR)/$(MACH)/$(PLATFORM)
#
# Sources and objects used to build the C-based bootblock for
# deprecated OBP V0 and V2 platforms.
#
OBPDEP_C_SRCS = stub.c
OBPDEP_S_SRCS =
OBPDEP_SRCS = $(OBPDEP_C_SRCS) $(OBPDEP_S_SRCS)
OBPDEP_SRT = obp_srt0.o
OBPDEP_OBJS = $(OBPDEP_C_SRCS:%.c=%.o) $(OBPDEP_S_SRCS:%.s=%.o) bbvers.o
OBPDEP_L_OBJS = $(OBPDEP_SRT:%.o=%.ln) $(OBPDEP_OBJS:%.o=%.ln)
OBPDEP_LD_LIBS =
#
# Rules used to build boot blocks. PROM_TYPE is defined in the platform
# specific Makefile in ../<fs>/<mach>/<platform>/Makefile and is set to one
# of OBP or IEEE1275.
#
BOOT_OBJS = $($(PROM_TYPE)_OBJS)
BOOT_SRT = $($(PROM_TYPE)_SRT)
BOOT_L_OBJS = $($(PROM_TYPE)_L_OBJS)
BOOT_LD_LIBS = $($(PROM_TYPE)_LD_LIBS)
MAPFILE = $(OBPMACHDIR)/mapfile
CPPINCS += -I$(OBPCMNDIR) -I$(PSMSYSHDRDIR)
CPPFLAGS += -D_BOOT -D_KERNEL
CPPFLAGS += $(CPPINCS) $(CCYFLAG)$(PSMSYSHDRDIR)
ASFLAGS += -D_BOOT -D_ASM -P $(CPPINCS)
LDFLAGS = -dn -e start -M $(MAPFILE)
LDLIBS = $(BOOT_LD_LIBS)
#
# lint pass1 enforcement
#
CFLAGS += $(CCVERBOSE)
MKBOOT = mkboot
MKVERS = makevers
#
# Pattern matching rules to compile the source in this directory
#
%.o: $(OBPCMNDIR)/%.c
$(COMPILE.c) -o $@ $<
%.o: $(OBPMACHDIR)/%.s
$(COMPILE.s) -o $@ $<
%.o: $(OBPMACHDIR)/%.c
$(COMPILE.c) -o $@ $<
%.o: $(OBPPLATDIR)/%.s
$(COMPILE.s) -o $@ $<
%.ln: $(OBPCMNDIR)/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
%.ln: $(OBPMACHDIR)/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
%.ln: $(OBPMACHDIR)/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
%.ln: $(OBPPLATHDIR)/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
%: $(OBPCMNDIR)/%.sh
$(RM) $@
cat $< > $@
chmod +x $@