13e76f9d6SRichard Lowe# 23e76f9d6SRichard Lowe# CDDL HEADER START 33e76f9d6SRichard Lowe# 43e76f9d6SRichard Lowe# The contents of this file are subject to the terms of the 53e76f9d6SRichard Lowe# Common Development and Distribution License (the "License"). 63e76f9d6SRichard Lowe# You may not use this file except in compliance with the License. 73e76f9d6SRichard Lowe# 83e76f9d6SRichard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93e76f9d6SRichard Lowe# or http://www.opensolaris.org/os/licensing. 103e76f9d6SRichard Lowe# See the License for the specific language governing permissions 113e76f9d6SRichard Lowe# and limitations under the License. 123e76f9d6SRichard Lowe# 133e76f9d6SRichard Lowe# When distributing Covered Code, include this CDDL HEADER in each 143e76f9d6SRichard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153e76f9d6SRichard Lowe# If applicable, add the following below this CDDL HEADER, with the 163e76f9d6SRichard Lowe# fields enclosed by brackets "[]" replaced with your own identifying 173e76f9d6SRichard Lowe# information: Portions Copyright [yyyy] [name of copyright owner] 183e76f9d6SRichard Lowe# 193e76f9d6SRichard Lowe# CDDL HEADER END 203e76f9d6SRichard Lowe# 213e76f9d6SRichard Lowe# 223e76f9d6SRichard Lowe# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 233e76f9d6SRichard Lowe# Use is subject to license terms. 243e76f9d6SRichard Lowe# 25*44bf619dSJohn Levon# Copyright 2019 Joyent, Inc. 26*44bf619dSJohn Levon# 273e76f9d6SRichard Lowe 283e76f9d6SRichard LoweCRTI = crti.o 293e76f9d6SRichard LoweCRTN = crtn.o 303e76f9d6SRichard LoweCRT1 = crt1.o 313e76f9d6SRichard LoweVALUES = values-Xa.o values-Xc.o values-Xs.o values-Xt.o \ 323e76f9d6SRichard Lowe values-xpg4.o values-xpg6.o 333e76f9d6SRichard LoweCOMMON_CRT = common-crt.o 343e76f9d6SRichard LoweMACH_CRT = mach-crt1.o 353e76f9d6SRichard Lowe 363e76f9d6SRichard Lowe# include library definitions 373e76f9d6SRichard Loweinclude ../../Makefile.lib 383e76f9d6SRichard Lowe 393e76f9d6SRichard LoweSRCS = $(VALUES:%.o=../common/%.c) $(COMMON_CRT:%.o=../common/%.c) 403e76f9d6SRichard Lowe 413e76f9d6SRichard LowePOST_PROCESS_O = $(PROCESS_COMMENT) $@ ; $(STRIP) -x $@ 423e76f9d6SRichard Lowe 433e76f9d6SRichard LoweOBJECTS = $(VALUES) $(CRT1) $(CRTI) $(CRTN) 443e76f9d6SRichard Lowe 453e76f9d6SRichard LoweROOTLIB= $(ROOT)/usr/lib 463e76f9d6SRichard LoweROOTLIB64= $(ROOTLIB)/$(MACH64) 473e76f9d6SRichard LoweROOTOBJECTS= $(OBJECTS:%=$(ROOTLIB)/%) 483e76f9d6SRichard LoweROOTOBJECTS64= $(OBJECTS:%=$(ROOTLIB64)/%) 493e76f9d6SRichard Lowe 503e76f9d6SRichard Lowe$(INTEL_BLD)ROOTOBJECTS += $(ROOTLIB)/gcrt1.o 513e76f9d6SRichard Lowe$(INTEL_BLD)ROOTOBJECTS64 += $(ROOTLIB64)/gcrt1.o 523e76f9d6SRichard Lowe 533e76f9d6SRichard LoweASFLAGS += -P -D__STDC__ -D_ASM -DPIC $(AS_PICFLAGS) 543e76f9d6SRichard Lowe 553e76f9d6SRichard Lowevalues-xpg6.o := CPPFLAGS += -I$(SRC)/lib/libc/inc 563e76f9d6SRichard Lowe$(COMMON_CRT) $(VALUES) := CFLAGS += $(C_PICFLAGS) 573e76f9d6SRichard Lowe$(COMMON_CRT) $(VALUES) := CFLAGS64 += $(C_PICFLAGS64) 583e76f9d6SRichard Lowe 59*44bf619dSJohn Levon# intentional double exit 60*44bf619dSJohn LevonSMOFF += unreachable 61*44bf619dSJohn Levon 623e76f9d6SRichard Lowe.KEEP_STATE: 633e76f9d6SRichard Lowe 643e76f9d6SRichard Loweall: $(OBJECTS) 653e76f9d6SRichard Lowe 663e76f9d6SRichard Loweclean clobber: 673e76f9d6SRichard Lowe $(RM) $(OBJECTS) 683e76f9d6SRichard Lowe 693e76f9d6SRichard Lowe 703e76f9d6SRichard Lowe$(CRT1): $(COMMON_CRT) $(MACH_CRT) 713e76f9d6SRichard Lowe $(LD) -r $(MACH_CRT) $(COMMON_CRT) -o $(CRT1) 723e76f9d6SRichard Lowe 733e76f9d6SRichard Lowe%.o: ../common/%.c 743e76f9d6SRichard Lowe $(COMPILE.c) -o $@ $< 753e76f9d6SRichard Lowe $(POST_PROCESS_O) 763e76f9d6SRichard Lowe 773e76f9d6SRichard Lowe%.o: %.s 783e76f9d6SRichard Lowe $(COMPILE.s) -o $@ $< 793e76f9d6SRichard Lowe $(POST_PROCESS_O) 803e76f9d6SRichard Lowe 813e76f9d6SRichard Lowe%.o: ../$(MACH)/%.s 823e76f9d6SRichard Lowe $(COMPILE.s) -o $@ $< 833e76f9d6SRichard Lowe $(POST_PROCESS_O) 843e76f9d6SRichard Lowe 853e76f9d6SRichard Lowe# install rule for ROOTOBJECTS and ROOTOBJECTS64 863e76f9d6SRichard Lowe$(ROOTLIB)/%.o: %.o 873e76f9d6SRichard Lowe $(INS.file) 883e76f9d6SRichard Lowe 893e76f9d6SRichard Lowe$(ROOTLIB)/gcrt1.o: 903e76f9d6SRichard Lowe $(RM) $(ROOTLIB)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB)/gcrt1.o 913e76f9d6SRichard Lowe 923e76f9d6SRichard Lowe$(ROOTLIB64)/%.o: %.o 933e76f9d6SRichard Lowe $(INS.file) 943e76f9d6SRichard Lowe 953e76f9d6SRichard Lowe$(ROOTLIB64)/gcrt1.o: 963e76f9d6SRichard Lowe $(RM) $(ROOTLIB64)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB64)/gcrt1.o 973e76f9d6SRichard Lowe 983e76f9d6SRichard LoweFRC: 99