Home | History | Annotate | Download | only in uts
      1      0    stevel #
      2      0    stevel # CDDL HEADER START
      3      0    stevel #
      4      0    stevel # The contents of this file are subject to the terms of the
      5   3448  dh155122 # Common Development and Distribution License (the "License").
      6   3448  dh155122 # You may not use this file except in compliance with the License.
      7      0    stevel #
      8      0    stevel # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9      0    stevel # or http://www.opensolaris.org/os/licensing.
     10      0    stevel # See the License for the specific language governing permissions
     11      0    stevel # and limitations under the License.
     12      0    stevel #
     13      0    stevel # When distributing Covered Code, include this CDDL HEADER in each
     14      0    stevel # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15      0    stevel # If applicable, add the following below this CDDL HEADER, with the
     16      0    stevel # fields enclosed by brackets "[]" replaced with your own identifying
     17      0    stevel # information: Portions Copyright [yyyy] [name of copyright owner]
     18      0    stevel #
     19      0    stevel # CDDL HEADER END
     20      0    stevel #
     21      0    stevel #
     22   9565    Jordan # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23      0    stevel # Use is subject to license terms.
     24      0    stevel #
     25      0    stevel # include global definitions
     26      0    stevel include ../Makefile.master
     27      0    stevel 
     28      0    stevel #
     29      0    stevel # List of architectures to build as part of the standard build.
     30      0    stevel #
     31   6094     akolb # Some of these architectures are built in parallel (see i386_PARALLEL and
     32   6094     akolb # sparc_PARALLEL). This requires building some parts first before parallel build
     33   6094     akolb # can start. Platform make files know what should be built as a prerequisite for
     34   6094     akolb # the parallel build to work. The i386_PREREQ and sparc_PREREQ variables tell
     35   6094     akolb # which platform directory to enter to start making prerequisite dependencies.
     36      0    stevel #
     37      0    stevel sparc_ARCHITECTURES = sun4v sun4u sparc
     38      0    stevel 
     39   6094     akolb i386_ARCHITECTURES = i86pc i86xpv intel
     40   6094     akolb 
     41   6094     akolb #
     42   6094     akolb # For i386 all architectures can be compiled in parallel.
     43   6094     akolb #
     44   6094     akolb # intel/Makefile knows how to build prerequisites needed for parallel build.
     45   6094     akolb #
     46   6094     akolb i386_PREREQ = intel
     47   6094     akolb i386_PARALLEL = $(i386_ARCHITECTURES)
     48   6094     akolb 
     49   6094     akolb #
     50   6094     akolb # For sparc all architectures can be compiled in parallel.
     51   6094     akolb #
     52   6094     akolb # sun4/Makefile knows how to build prerequisites needed for parallel build.
     53   6094     akolb # can start.
     54   6094     akolb #
     55   6094     akolb sparc_PREREQ = sun4
     56   6094     akolb sparc_PARALLEL = $(sparc_ARCHITECTURES)
     57   6094     akolb 
     58   6094     akolb #
     59   6094     akolb # Platforms defined in $(MACH)_PARALLEL are built in parallel. DUMMY is placed
     60   6094     akolb # at the end in case $(MACH)_PARALLEL is empty to prevent everything going in
     61   6094     akolb # parallel.
     62   6094     akolb #
     63   6094     akolb .PARALLEL: $($(MACH)_PARALLEL) DUMMY
     64   6094     akolb 
     65   6094     akolb #
     66   6094     akolb # For build prerequisites we use a special target which is constructed by adding
     67   6094     akolb # '.prereq' suffix to the $(MACH)_PREREQ.
     68   6094     akolb #
     69   6094     akolb PREREQ_TARGET = $($(MACH)_PREREQ:%=%.prereq)
     70   6094     akolb 
     71      0    stevel 
     72      0    stevel def		:=	TARGET= def
     73      0    stevel all		:=	TARGET= all
     74      0    stevel install		:=	TARGET= install
     75      0    stevel install_h	:=	TARGET= install_h
     76      0    stevel clean		:=	TARGET= clean
     77      0    stevel clobber		:=	TARGET= clobber
     78      0    stevel lint		:=	TARGET= lint
     79      0    stevel clean.lint	:=	TARGET= clean.lint
     80      0    stevel check		:=	TARGET= check
     81   1167    kupfer modlist		:=	TARGET= modlist
     82   1167    kupfer modlist		:=	NO_STATE= -K $$MODSTATE$$$$
     83      0    stevel 
     84      0    stevel .KEEP_STATE:
     85      0    stevel 
     86      0    stevel def all lint: all_h $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
     87      0    stevel 
     88      0    stevel install: all_h install_dirs $(PMTMO_FILE) $($(MACH)_ARCHITECTURES)
     89      0    stevel 
     90      0    stevel install_dirs:
     91      0    stevel 	@cd ..; pwd; $(MAKE) rootdirs
     92      0    stevel 	@pwd
     93      0    stevel 
     94   6094     akolb #
     95   6094     akolb # Rule to build prerequisites. The left part of the pattern will match
     96   6094     akolb # PREREQ_TARGET.
     97   6094     akolb #
     98   6094     akolb # The location of the Makefile is determined by strippinng '.prereq' suffix from
     99   6094     akolb # the target name. We add '.prereq' suffix to the target passed to the child
    100   6094     akolb # Makefile so that it can distinguish prerequisite build from the regular one.
    101   6094     akolb #
    102   6094     akolb #
    103   6094     akolb %.prereq:
    104   6094     akolb 	@cd $(@:%.prereq=%); pwd; $(MAKE) $(NO_STATE) $(TARGET).prereq
    105   6094     akolb 
    106   6094     akolb #
    107   6094     akolb # Rule to build architecture files. Build all required prerequisites and then
    108   6094     akolb # build the rest (potentially in parallel).
    109   6094     akolb #
    110   6094     akolb $($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC
    111   1167    kupfer 	@cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET)
    112      0    stevel 
    113      0    stevel $(PMTMO_FILE) pmtmo_file: $(PATCH_MAKEUP_TABLE)
    114      0    stevel 	@if [ -z "$(PATCH_MAKEUP_TABLE)" ] ; then \
    115      0    stevel 		echo 'ERROR: $$(PATCH_MAKEUP_TABLE) not set' \
    116      0    stevel 		    'in environment' >&2 ; \
    117      0    stevel 		exit 1 ; \
    118      0    stevel 	fi
    119      0    stevel 	RELEASE="$(RELEASE)" MACH="$(MACH)" \
    120      0    stevel 	    $(CTFCVTPTBL) -o $(PMTMO_FILE) $(PATCH_MAKEUP_TABLE)
    121      0    stevel 
    122      0    stevel #
    123      0    stevel # The following is the list of directories which contain Makefiles with
    124      0    stevel # targets to install header file. The machine independent headers are
    125      0    stevel # installed by invoking the Makefile in the directory containing the
    126      0    stevel # header files. Machine and architecture dependent headers are installed
    127      0    stevel # by invoking the main makefile for that architecture/machine which,
    128      0    stevel # in turn, is responsible for invoking the Makefiles which install headers.
    129      0    stevel # It is done this way so as not to assume that all of the header files in
    130      0    stevel # the architecture/machine dependent subdirectories are in completely
    131      0    stevel # isomorphic locations.
    132      0    stevel #
    133   7836      John COMMON_HDRDIRS= common/avs \
    134   7836      John 		common/c2 \
    135   7836      John 		common/des \
    136   7836      John 		common/fs \
    137   7836      John 		common/gssapi \
    138   7836      John 		common/idmap \
    139   7836      John 		common/inet \
    140   7836      John 		common/inet/ipf/netinet \
    141   7836      John 		common/inet/kssl \
    142   7836      John 		common/inet/nca \
    143  10639    Darren 		common/inet/sockmods/netpacket \
    144  10639    Darren 		common/io/bpf/net \
    145   7836      John 		common/ipp \
    146   7836      John 		common/net \
    147   7836      John 		common/netinet \
    148   7836      John 		common/nfs \
    149   7836      John 		common/pcmcia/sys \
    150   7836      John 		common/rpc \
    151   7836      John 		common/rpcsvc \
    152   7836      John 		common/sharefs \
    153   7836      John 		common/smbsrv \
    154   7836      John 		common/sys \
    155   7836      John 		common/vm
    156   7836      John 
    157   3448  dh155122 
    158   1167    kupfer # These aren't the only headers in closed.  But the other directories
    159   1167    kupfer # are simple enough that they can be driven from the src tree.
    160   1167    kupfer $(CLOSED_BUILD)COMMON_HDRDIRS += $(CLOSED)/uts/common/sys
    161      0    stevel 
    162   9565    Jordan #
    163   9565    Jordan # Subset of COMMON_HDRDIRS in which at least one header is generated
    164   9565    Jordan # at runtime (e.g., rpcgen).  (This is a partial list; there are
    165   9565    Jordan # other directories that should be included and do not yet have the
    166   9565    Jordan # necessary Makefile support.  See 6414855.)
    167   9565    Jordan #
    168  10563     Binzi DYNHDRDIRS = common/rpcsvc common/idmap common/sys
    169   9565    Jordan 
    170      0    stevel sparc_HDRDIRS= sun/sys
    171   5084   johnlev i386_HDRDIRS= i86pc/vm i86xpv/vm
    172      0    stevel 
    173      0    stevel HDRDIRS= $(COMMON_HDRDIRS) $($(MACH)_HDRDIRS)
    174      0    stevel install_h check: $(HDRDIRS) $($(MACH)_ARCHITECTURES)
    175      0    stevel 
    176      0    stevel $(HDRDIRS): FRC
    177      0    stevel 	@cd $@; pwd; $(MAKE) $(TARGET)
    178      0    stevel 
    179      0    stevel # ensures that headers made by rpcgen and others are available in uts source
    180      0    stevel # for kernel builds to reference without building install_h
    181      0    stevel #
    182      0    stevel all_h: FRC
    183      0    stevel 	@cd common/sys; pwd; $(MAKE) $@
    184      0    stevel 	@cd common/rpc; pwd; $(MAKE) $@
    185      0    stevel 	@cd common/rpcsvc; pwd; $(MAKE) $@
    186      0    stevel 	@cd common/gssapi; pwd; $(MAKE) $@
    187   4520  nw141292 	@cd common/idmap; pwd; $(MAKE) $@
    188   9565    Jordan 
    189   9565    Jordan clean clobber: $($(MACH)_ARCHITECTURES) $(DYNHDRDIRS)
    190   9565    Jordan 	@if [ '$(PATCH_BUILD)' != '#' ] ; then \
    191   9565    Jordan 		echo $(RM) $(PMTMO_FILE) ; \
    192   9565    Jordan 		$(RM) $(PMTMO_FILE) ; \
    193   9565    Jordan 	fi
    194   9565    Jordan 
    195   9565    Jordan EXTRA_CLOBBER_TARGETS= common/avs/ns/rdc
    196   9565    Jordan clobber: $(EXTRA_CLOBBER_TARGETS)
    197   9565    Jordan 
    198   9565    Jordan 
    199   9565    Jordan clean.lint modlist: $($(MACH)_ARCHITECTURES)
    200      0    stevel 
    201      0    stevel ONC_FILES=	common/io/timod.c \
    202      0    stevel 		common/os/sig.c \
    203      0    stevel 		common/os/flock.c \
    204      0    stevel 		common/os/sysent.c \
    205      0    stevel 		common/os/swapgeneric.c \
    206      0    stevel 		common/syscall/fcntl.c 
    207      0    stevel 
    208      0    stevel # edit onc plus source files. 
    209      0    stevel ONC_PLUS:	$(ONC_FILES:%=%_onc_plus) 
    210      0    stevel 
    211      0    stevel #
    212      0    stevel # Cross-reference customization: build a cross-reference over all of
    213      0    stevel # the supported architectures.  Although there's no correct way to set
    214      0    stevel # the include path (since we don't know what architecture is the one
    215      0    stevel # the user will be interested in), it's historically been set to
    216      0    stevel # mirror the $(XRDIRS) list, and that works kinda sorta okay.
    217      0    stevel #
    218   7612      Sean # We need to manually prune usr/closed/uts/{i86xpv|sfmmu|i86pc} since
    219   7612      Sean # none of them exist.
    220   5084   johnlev #
    221   1167    kupfer SHARED_XRDIRS = $(sparc_ARCHITECTURES) $(i386_ARCHITECTURES) sun4 sfmmu	\
    222   1167    kupfer 	sun common
    223   1167    kupfer CLOSED_XRDIRS = $(SHARED_XRDIRS:%=% ../../closed/uts/%)
    224   1167    kupfer XRDIRS = $(SHARED_XRDIRS)
    225   5084   johnlev CLOSED_XRDIRS_XEN = $(CLOSED_XRDIRS:../../closed/uts/i86xpv=)
    226   7612      Sean CLOSED_XRDIRS_1 = $(CLOSED_XRDIRS_XEN:../../closed/uts/i86pc=)
    227   7612      Sean $(CLOSED_BUILD)XRDIRS = $(CLOSED_XRDIRS_1:../../closed/uts/sfmmu=)
    228   1167    kupfer 
    229      0    stevel XRINCDIRS = $(XRDIRS)
    230      0    stevel 
    231      0    stevel cscope.out tags: FRC
    232      0    stevel 	$(XREF) -x $@
    233      0    stevel 
    234      0    stevel FRC:
    235