Home | History | Annotate | Download | only in src
      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/CDDL.txt
      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/CDDL.txt.
     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 #ident	"@(#)Makefile	1.18	08/06/09 SMI"
     24 #
     25 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     26 # Use is subject to license terms.
     27 #
     28 # Makefile for system source
     29 #
     30 
     31 include $(SRC)/Makefile.master
     32 
     33 SUBDIRS= cmd
     34 
     35 MSGSUBDIRS= cmd
     36 
     37 all :=		TARGET= all
     38 install :=	TARGET= install
     39 clean :=	TARGET= clean
     40 clobber :=	TARGET= clobber
     41 check :=	TARGET= check
     42 lint :=		TARGET= lint
     43 _msg :=		TARGET= _msg
     44 
     45 
     46 .KEEP_STATE:
     47 
     48 #
     49 # Note: install only builds the all target for the pkgdefs
     50 #       directory.  We are not yet ready to have an install
     51 #	build create 'packages' also.  To build packages
     52 #	cd pkgdefs and do a 'make install'
     53 #
     54 all: closedbins rootdirs .WAIT $(SUBDIRS) pkg_all
     55 
     56 install: closedbins rootdirs .WAIT $(SUBDIRS) pkg_all .WAIT _msg
     57 	@cd pkgdefs/SUNW0scds; pwd; $(MAKE) _msg
     58 	@rm -rf "$(VROOT)/catalog"
     59 
     60 clean clobber: $(SUBDIRS) pkgdefs clean_scmsgs
     61 
     62 check:
     63 
     64 lint: $(SUBDIRS)
     65 
     66 _msg: rootdirs .WAIT $(MSGSUBDIRS)
     67 
     68 pkg_all:
     69 	@cd pkgdefs; pwd; $(MAKE) all
     70 
     71 $(SUBDIRS) pkgdefs: FRC
     72 	@cd $@; pwd; $(MAKE) $(TARGET)
     73 
     74 # Copy any prebuilt closed source binaries
     75 closedbins: FRC
     76 	@CLOSED_VROOT="$(SC_CLOSED_BINS)/$(TARGET_ROOT)"; \
     77 	if [ -n "$(CLOSED_BUILD)" ]; then \
     78 		if [ ! -d "$$CLOSED_VROOT" ]; then \
     79 			$(ECHO) "Error: if closed sources are not present," \
     80 			    "SC_CLOSED_BINS must point to closed binaries."; \
     81 			$(ECHO) "$(TARGET_ROOT) is not" \
     82 			    "present in $(SC_CLOSED_BINS)."; \
     83 			exit 1; \
     84 		fi; \
     85 		$(ECHO) "Copying closed binaries from $$CLOSED_VROOT"; \
     86 		mkdir -p $(VROOT); \
     87 		(cd $$CLOSED_VROOT && tar cf - .) | \
     88 		    (cd $(VROOT) && tar xBpf -); \
     89 	fi
     90 
     91 # Create proto directories from package prototypes
     92 rootdirs: FRC
     93 	@cd pkgdefs; $(MAKE) all makefiles
     94 	$(MAKE) -f Makefile.rootdirs rootdirs
     95 
     96 # standard scmsgs
     97 scmsgs: FRC
     98 	$(SCMSGS_BIN)/scmsgs_toplevel . cmd $(CLOSED)/cmd
     99 
    100 clean_scmsgs:
    101 	$(RM) scmsgs-* nothing_to_remove
    102 
    103 # cscope
    104 $(CLOSED_BUILD)XRDIRS += ../closed
    105 XRADD = *.java *.ksh *.pl *.sh
    106 
    107 cscope.out tags: FRC
    108 	$(XREF) -f -x $@
    109 
    110 patch_build:
    111 	@cd pkgdefs; pwd; $(MAKE) patch_build
    112 
    113 FRC:
    114 
    115