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.
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.
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]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # psm/stand/cpr/common/Makefile.com
29 TOPDIR = ../../../../..
31 include $(TOPDIR)/Makefile.master
32 include $(TOPDIR)/Makefile.psm
33 include $(TOPDIR)/psm/stand/lib/Makefile.lib
35 SYSDIR = $(TOPDIR)/uts
37 OSDIR = $(SRCTOP)/kernel/os
38 ARCHDIR = $(SYSDIR)/$(ARCH)
39 MACHDIR = $(SYSDIR)/$(MACH)
40 MMUDIR = $(SYSDIR)/$(MMU)
41 PROMLIBDIR= $(TOPDIR)/psm/stand/lib/promif/$(ARCH_PROMDIR)
42 PROMLIB = $(PROMLIBDIR)/libprom.a
45 LDLIBS += -L$(PROMLIBDIR) -lprom
46 LDFLAGS = -dn -M mapfile $(MAP_FLAG)
48 CPRBOOTOBJ += support.o compress.o
50 L_SRCS = $(COMDIR)/support.c $(OSDIR)/compress.c
51 L_COBJ = $(CPRBOOTOBJ:%.o=%.ln)
53 CPPDEFS = $(ARCHOPTS) -D$(ARCH) -D__$(ARCH) -D$(MACH) -D__$(MACH)
54 CPPDEFS += -D_KERNEL -D_MACHDEP -D__ELF
56 CPPINCS = -I. -I$(ARCHDIR) -I$(MMUDIR) -I$(MACHDIR)
57 CPPINCS += -I$(MACHDIR)/$(ARCHVER) -I$(SYSDIR)/sun
58 CPPINCS += -I$(SYSDIR)/sun4 -I$(SYSDIR)/common
59 CPPINCS += -I$(TOPDIR)/../../include
61 CPPFLAGS = $(CPPDEFS) $(CPPINCS) $(CPPFLAGS.master)
62 CPPFLAGS += $(CCYFLAG) -I$(SYSDIR)/common
64 C99MODE = $(C99_ENABLE)
65 CFLAGS = -O $(C99MODE)
67 ASFLAGS = -D_ASM $(CPPDEFS) -DLOCORE -D_LOCORE
68 AS_CPPFLAGS = $(CPPINCS) $(CPPFLAGS.master)
71 CPRFILES= $(ALL:%=$(ROOT_PSM_DIR)/$(ARCH)/%)
75 $(ROOT_PSM_DIR)/$(ARCH)/%: %
81 install: all $(CPRFILES)
85 compress.o: $(OSDIR)/compress.c
86 $(COMPILE.c) $(OSDIR)/compress.c
88 support.o: $(COMDIR)/support.c
89 $(COMPILE.c) $(COMDIR)/support.c
93 .PARALLEL: $(CPRBOOTOBJ) $(L_COBJ)
95 cprboot: $(CPRBOOT_MAPFILE) $(CPRBOOTOBJ) $(SALIBS)
96 $(LD) $(LDFLAGS) -o $@ $(CPRBOOTOBJ) $(LDLIBS)
101 @cd $(@D); $(MAKE) $(MFLAGS)
110 $(RM) *.o *.ln $(ALL)