Makefile revision 02e56f3f1bfc8d9977bafb8cb5202f576dcded27
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews#
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater#
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater#
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0519188c8e1ae76978fc4e0f799620cd36eba07aAutomatic Updater# or http://www.opensolaris.org/os/licensing.
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews# See the License for the specific language governing permissions
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# If applicable, add the following below this CDDL HEADER, with the
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater#
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# Use is subject to license terms.
831f79c4310a7d38fc3475ccfff531b2b2535641Automatic Updater#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# ident "%Z%%M% %I% %E% SMI"
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater#
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater#
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# This makefile drives the production of unix (and unix.o).
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# sun4u starcat implementation architecture dependent
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater#
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Path to the base of the uts directory tree (usually /usr/src/uts).
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt#
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic UpdaterUTSBASE = ../../..
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt#
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# Define the module and object file sets.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater#
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterUNIX = unix
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater $(CORE_OBJS:%=$(OBJS_DIR)/%) \
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan HuntLINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(LINTS_DIR)/vers.ln \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(LINTS_DIR)/modstubs.ln
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterROOTMODULE = $(ROOT_STARCAT_KERN_DIR)/$(UNIX)
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic UpdaterUNIX_BIN = $(OBJS_DIR)/$(UNIX)
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterKRTLD_32 = misc/krtld
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterKRTLD_64 = misc/$(SUBDIR64)/krtld
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterKRTLD = $(KRTLD_$(CLASS))
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark AndrewsLIBS = $(GENLIB) $(PLATLIB) $(CPULIB)
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark AndrewsGENUNIX = genunix
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonGENUNIX_DIR = ../../$(GENUNIX)
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic UpdaterGENOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic UpdaterCPU_DIR = .
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic UpdaterCPUOPTS = -L $(CPU_DIR)/$(OBJS_DIR) -l $(CPUNAME)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic UpdaterPLAT_DIR = ../../platmod
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsPLATOPTS = -L $(PLAT_DIR)/$(OBJS_DIR) -l $(PLATMOD)
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater
80faf1588895fd26490f82f95a7a1b771df1c324Automatic UpdaterLIBOPTS = $(GENOPTS) $(PLATOPTS) $(CPUOPTS)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic UpdaterCTFEXTRAOBJS = $(OBJS_DIR)/vers.o
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater#
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater# Include common rules.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterinclude $(UTSBASE)/sun4u/starcat/Makefile.starcat
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Define targets
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterALL_TARGET = $(UNIX_BIN)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonLINT_TARGET = $(LINT_LIB)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterINSTALL_TARGET = $(UNIX_BIN) $(ROOTMODULE)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Overrides
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater#
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic UpdaterALL_BUILDS = $(ALL_BUILDSONLY64)
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsDEF_BUILDS = $(DEF_BUILDSONLY64)
11af78f7dc35741bdab68dbab11b03daab005b28Automatic UpdaterSYM_BUILDS = $(DEF_BUILDSONLY64)
11af78f7dc35741bdab68dbab11b03daab005b28Automatic UpdaterCLEANLINTFILES += $(LINT32_FILES)
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont#
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# This is UNIX_DIR. Use a short path.
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater#
2a31bd531072824ef252c18303859d6af7451b00Francis DupontUNIX_DIR = .
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater#
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater# Overrides
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsCLEANFILES += $(UNIX_O) $(MODSTUBS_O) $(OBJS_DIR)/vers.c \
08e3b6797706a13054bad749dea04e94b514b8e7Automatic Updater $(OBJS_DIR)/vers.o $(CPU_OBJ) $(CPULIB) \
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater $(DTRACESTUBS_O) $(DTRACESTUBS)
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark AndrewsCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN)
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic UpdaterCLEANLINTFILES += $(LINT_LIB)
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# lint pass one enforcement
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# Turn on doubleword alignment for 64 bit counter timer registers
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsCFLAGS += $(CCVERBOSE) -dalign
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Default build targets.
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater#
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater.KEEP_STATE:
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterdef: $(DEF_DEPS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updaterall: $(ALL_DEPS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterclean: $(CLEAN_DEPS)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterclobber: $(CLOBBER_DEPS)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonlint: $(LINT_DEPS)
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updaterclean.lint: $(CLEAN_LINT_DEPS)
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updaterinstall: $(INSTALL_DEPS)
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updatersymcheck: $(SYM_DEPS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE) $(LIBS) $(DTRACESTUBS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater $(LD) -dy -b -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
4104e236f71eb5108fcfda6711878a97f6f4a8e7Automatic Updater $(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater $(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater $(POST_PROCESS)
0ce87e5749aabb8eef1e0a37e4bd6e6ffa1d7196Automatic Updater
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updatersymcheck.targ: $(UNIX_O) $(MODSTUBS_O) $(LIBS) $(DTRACESTUBS)
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater $(LD) -dy -b -o $(SYM_MOD) -M $(MAPFILE) \
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater $(UNIX_O) $(MODSTUBS_O) $(LIBOPTS) $(DTRACESTUBS)
3e5340279d8875d136a4dd815cccad0044aa2644Automatic Updater
8ccd7da886e93cd490fcb6f4c4e98a6514f35820Automatic Updater#$(UNIX).glom: $(UNIX)
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater# ${LD} -dy -b -z nodefs -o $@ -e _start -I $(KRTLD) -M $(MAPFILE) \
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# $(UNIX_O) $(MODSTUBS_O) $(GENUNIX_DIR)/$(GENUNIX)
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updater# $(POST_PROCESS)
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
1d4f4d2db2d69e48fec2dde5c1535853677d22a7Automatic Updater $(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater#
9c446b72069d0ab9f710502f4d7048e50875fccbAutomatic Updater# Special rules for generating assym.h for inclusion in assembly files.
e85565067cf73f8cc21ee29b11761659f1d47ee9Automatic Updater#
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater$(DSF_DIR)/$(OBJS_DIR)/assym.h: FRC
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater @cd $(DSF_DIR); $(MAKE) all.targ
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater$(GENLIB): FRC
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater @(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @pwd
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater$(PLATLIB):
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater ?@(cd $(PLAT_DIR); pwd; $(MAKE) all.targ)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater ?@pwd
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater#
da82e232161d67b77df2d67898bdac693f647be1Automatic Updater# CPU_OBJ now comprises of 2 object files which come from sun4 common
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# and from architecture dependent code. OBJS_DIR is prepended where
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater# CPU_DIR is defined to allow for building multiple CPU_OBJ's
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater$(CPULIB): $(CPU_OBJ)
7f94d9a8162c9a96b56e66176702b66e79d8e1a2Automatic Updater $(BUILD.SO) $(CPU_OBJ)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
5ecad47f69b3fd945472ab2900a9ff826a7ce2f6Automatic Updater# The global lint target builds the kernel lint library (llib-lunix.ln)
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# which is equivalent to a lint of /unix.o. Then all kernel modules for
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# this architecture are linted against the kernel lint library.
71bd43eebd9d6e42dbcae62b730f5b6508d5acd8Automatic Updater#
82447d835d3ff5c658749b4e9b4f66166407b3eaAutomatic Updater# Note: lint errors in the kernel lint library will be repeated for
7262eb86f2b465822206122921e2f357218f0cfdAutomatic Updater# each module. It is important that the kernel lint library
96ea71632887c58a9d00f47eb318bf76b35903c3Mark Andrews# be clean to keep the textual output to a reasonable level.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater
bbb069be941f649228760edcc241122933c066d2Automatic Updater$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater @-$(ECHO) "\n$(UNIX): (library construction):"
4cda4fd158d6ded5586bacea8c388445d99611eaAutomatic Updater @$(LINT) -o $(UNIX) $(LINTFLAGS) $(LINTS)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @$(MV) $(@F) $@
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updaterlintlib: $(LINT_DEPS)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater# Include common targets.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsinclude $(UTSBASE)/sun4u/starcat/Makefile.targ
765c97d56ccddc9d7904c7d9ff2e2d825d9687e4Automatic Updater