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 #
  23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 #
  28 #       Path to the base of the uts directory tree (usually /usr/src/uts).
  29 #
  30 UTSBASE = ../../..
  31 
  32 #
  33 #       Define the module and object file sets.
  34 #
  35 UNIX            = unix
  36 OBJECTS         = $(BCM2835_OBJS:%=$(OBJS_DIR)/%) \
  37                   $(CORE_OBJS:%=$(OBJS_DIR)/%) \
  38                   $(KRTLD_OBJS:%=$(OBJS_DIR)/%)
  39 
  40 ROOTMODULE      = $(ROOT_BCM2835_KERN_DIR)/$(UNIX)
  41 UNIX_BIN        = $(OBJS_DIR)/$(UNIX)
  42 
  43 LIBS            = $(GENLIB)
  44 
  45 GENUNIX         = genunix
  46 GENUNIX_DIR     = ../../../arm/$(GENUNIX)
  47 GENOPTS         = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
  48 
  49 LIBOPTS         = $(GENOPTS)
  50 
  51 CTFEXTRAOBJS    = $(OBJS_DIR)/vers.o
  52 
  53 
  54 #
  55 #       Include common rules.
  56 #
  57 include $(UTSBASE)/armv6/bcm2835/Makefile.bcm2835
  58 
  59 #
  60 #       Define targets
  61 #
  62 ALL_TARGET      = $(UNIX_BIN)
  63 INSTALL_TARGET  = $(UNIX_BIN) $(ROOTMODULE)
  64 
  65 #
  66 #       This is UNIX_DIR. Use a short path.
  67 #
  68 UNIX_DIR        = .
  69 
  70 #
  71 #       Overrides
  72 #
  73 CLEANFILES      += $(OBJECTS) \
  74                    $(UNIX_O)
  75 
  76 CLOBBERFILES    = $(CLEANFILES) $(UNIX_BIN)
  77 
  78 CFLAGS += $(CCVERBOSE)
  79 
  80 CERRWARN        += -_gcc=-Wno-parentheses
  81 CERRWARN        += -_gcc=-Wno-uninitialized
  82 CERRWARN        += -_gcc=-Wno-unused-label
  83 CERRWARN        += -_gcc=-Wno-unused-function
  84 CERRWARN        += -_gcc=-Wno-unused-variable
  85 CERRWARN        += -_gcc=-Wno-unused-but-set-variable
  86 
  87 # The mapfile used to link unix
  88 MAPFILE         = $(UTSBASE)/armv6/bcm2835/conf/Mapfile
  89 
  90 #
  91 #       Default build targets.
  92 #
  93 .KEEP_STATE:
  94 
  95 def:            $(DEF_DEPS)
  96 
  97 all:            $(ALL_DEPS)
  98 
  99 clean:          $(CLEAN_DEPS)
 100 
 101 clobber:        $(CLOBBER_DEPS)
 102 
 103 MKPLATFORM      = $(UTSBASE)/$(PLATFORM)/tools/mkplatform.sh
 104 
 105 install:        $(INSTALL_DEPS)
 106         pfexec $(MKPLATFORM) -u $(ROOT_BCM2835_MOD_DIR:$(ROOT)/%=/%) $(UNIX_BIN) \
 107             $(GENUNIX_DIR)/$(OBJS_DIR)/genunix
 108         $(MV) boot_archive $(OBJS_DIR)/
 109 
 110 symcheck:       $(SYM_DEPS)
 111 
 112 $(UNIX_BIN): $(UNIX_O) $(MAPFILE) $(LIBS) $(DTRACESTUBS)
 113         $(LD) -dy -b -znointerp -o $@ -e _start -M $(MAPFILE) \
 114             $(UNIX_O) $(LIBOPTS) $(DTRACESTUBS)
 115         $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
 116         $(POST_PROCESS)
 117 
 118 $(UNIX_O):      $(OBJECTS) $(OBJS_DIR)/vers.o
 119         $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
 120 
 121 symcheck.targ:  $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS) 
 122         $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
 123         $(UNIX_O) $(KRTLD_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS) 
 124 
 125 $(KRTLD_O):     $(KRTLD_OBJECTS)
 126         $(LD) -r -o $@ -M$(KRTLD_MAPFILE) $(KRTLD_OBJECTS)
 127 
 128 #
 129 #       Include common targets.
 130 #
 131 include $(UTSBASE)/armv6/bcm2835/Makefile.targ