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 (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  25 #
  26 
  27 include         $(SRC)/Makefile.master
  28 include         $(SRC)/cmd/sgs/Makefile.var
  29 
  30 BUILDLOG=       package_build.$(MACH).log
  31 
  32 MACHS:sh=       if [ "$MACH" = "sparc" ]; \
  33                 then echo "sparc sparcv9"; \
  34                 elif [ "$MACH" = "i386" ]; \
  35                 then echo "i386 amd64"; \
  36                 else echo "unknown"; \
  37                 fi
  38 
  39 RDBDIRS=        $(MACHS:%=../librtld_db/demo/%)
  40 LDMAKEDIRS=     $(MACHS:%=../libldmake/%)
  41 
  42 SUBDIRS1=       ../libconv \
  43                 .WAIT \
  44                 ../libdl \
  45                 .WAIT \
  46                 ../libelf \
  47                 .WAIT \
  48                 ../liblddbg \
  49                 ../librtld_db \
  50                 .WAIT \
  51                 ../librtld \
  52                 ../libcrle
  53 
  54 SUBDIRS2 =      ../rtld \
  55                 ../rtld.4.x \
  56                 ../libldstab \
  57                 ../lari \
  58                 ../ldprof \
  59                 ../lddstub \
  60                 $(LDMAKEDIRS) \
  61                 ../0@0 \
  62                 ../tools \
  63                 $(RDBDIRS)
  64 
  65 #
  66 # Package dirs are directories which specifically
  67 # have a 'package' target.  This target is used to key
  68 # off of whether a system build is performed
  69 # or a SUNWonld build.
  70 #
  71 PKGDIRS=        ../libcrle \
  72                 ../libld \
  73                 ../elfdump \
  74                 ../elfedit \
  75                 ../elfedit/modules \
  76                 ../elfwrap \
  77                 ../ar \
  78                 ../crle \
  79                 ../dump \
  80                 ../lari \
  81                 ../ld \
  82                 ../ldd \
  83                 ../ldprof \
  84                 ../nm \
  85                 ../mcs \
  86                 ../moe \
  87                 ../pvs
  88 
  89 $(SUBDIRS1) $(SUBDIRS2) :=      TARGET = install
  90 $(PKGDIRS) :=   TARGET = package
  91 
  92 ../%:           FRC
  93                 @ cd $@; pwd; $(MAKE) $(TARGET)
  94 
  95 .KEEP_STATE_FILE: .make.state.$(MACH)
  96 .KEEP_STATE:
  97 .PARALLEL:      $(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2)
  98 
  99 all clean clobber install: FRC
 100                 @ cd $(MACH); pwd; $(MAKE) $@
 101 
 102 #
 103 # invoke `package' to build this package from scratch.  It will
 104 # perform make install in the directories that contains components
 105 # that this package is dependent upon
 106 #
 107 package:        FRC
 108         @/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG)
 109         @ echo "===BUILD COMPLETED  checking for warnings...==="
 110         @ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat
 111         @ echo "==================done========================="
 112 
 113 package_build:  package_dep .WAIT package_chkmsg .WAIT install
 114 
 115 package_chkmsg: FRC
 116                 @ cd ..; pwd; $(MAKE) chkmsg
 117 
 118 package_dep:    package_dep_ .WAIT $(SUBDIRS1) .WAIT \
 119         $(PKGDIRS) .WAIT $(SUBDIRS2)
 120 
 121 package_dep_:   FRC
 122                 @ cd ../tools; pwd; $(MAKE) proto && ./proto $(RELEASE)
 123                 @ cd $(SRC)/common/mapfiles/gen ; pwd; $(MAKE) install
 124                 @ cd $(SRC)/head; pwd; $(MAKE) \
 125                         $(ROOT)/usr/include/dlfcn.h \
 126                         $(ROOT)/usr/include/gelf.h \
 127                         $(ROOT)/usr/include/libelf.h \
 128                         $(ROOT)/usr/include/proc_service.h \
 129                         $(ROOT)/usr/include/rtld_db.h \
 130                         $(ROOT)/usr/include/link.h
 131                 @ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h
 132                 @ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \
 133                         $(ROOT)/usr/include/sys/elf.h \
 134                         $(ROOT)/usr/include/sys/elf_386.h \
 135                         $(ROOT)/usr/include/sys/elf_SPARC.h \
 136                         $(ROOT)/usr/include/sys/elf_notes.h \
 137                         $(ROOT)/usr/include/sys/elf_amd64.h \
 138                         $(ROOT)/usr/include/sys/elftypes.h \
 139                         $(ROOT)/usr/include/sys/auxv.h \
 140                         $(ROOT)/usr/include/sys/auxv_SPARC.h \
 141                         $(ROOT)/usr/include/sys/auxv_386.h \
 142                         $(ROOT)/usr/include/sys/avl.h \
 143                         $(ROOT)/usr/include/sys/link.h \
 144                         $(ROOT)/usr/include/sys/machelf.h \
 145                         $(ROOT)/usr/include/sys/note.h \
 146                         $(ROOT)/usr/include/sys/systeminfo.h
 147                 @ cd ../tools/$(MACH); pwd; $(MAKE) sgsmsg piglatin
 148                 @ cd ..; pwd; $(MAKE) _msg_sgsmsg
 149                 @ cd ..; pwd; $(MAKE) native-add
 150                 @ cd ../libconv; pwd; $(MAKE) all
 151                 @ cd ../link_audit; pwd; $(MAKE) package
 152                 @ cd ../messages/$(MACH); pwd; $(MAKE) test
 153 
 154 FRC: