17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 55aefb655Srie# Common Development and Distribution License (the "License"). 65aefb655Srie# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 215aefb655Srie 225aefb655Srie# 23c6c9aed4Sab196087# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 245aefb655Srie# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 261886f67eSGordon Ross# Copyright 2015 Nexenta Systems, Inc. All rights reserved. 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate%.o: ../common/%.c 305aefb655Srie $(COMPILE.c) -o $@ $< 315aefb655Srie $(POST_PROCESS_O) 325aefb655Srie 335aefb655Srie%32.o: ../common/%.c 345aefb655Srie $(COMPILE.c) -o $@ $< 355aefb655Srie $(POST_PROCESS_O) 365aefb655Srie 375aefb655Srie%64.o: ../common/%.c 385aefb655Srie $(COMPILE.c) -D_ELF64 -o $@ $< 397c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate%.o: $(SGSTOOLS)/common/%.c 425aefb655Srie $(COMPILE.c) -o $@ $< 437c478bd9Sstevel@tonic-gate $(POST_PROCESS_O) 447c478bd9Sstevel@tonic-gate 451886f67eSGordon Rossall: $(PROG) 46c6c9aed4Sab196087 471886f67eSGordon Ross$(PROG): $(OBJS) $(MAPFILE) check_struct_layout 487c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 497c478bd9Sstevel@tonic-gate $(POST_PROCESS) 507c478bd9Sstevel@tonic-gate 511886f67eSGordon Rosscheck_struct_layout: gen_struct_layout gen_layout_obj.o 521886f67eSGordon Ross sed -e '/^#include <struct_layout.h>/q' \ 531886f67eSGordon Ross ../common/struct_layout_$(ARCH).c | sed -e '$$d' \ 541886f67eSGordon Ross > struct_layout_$(ARCH).tmp 551886f67eSGordon Ross ./gen_struct_layout gen_layout_obj.o $(ARCH) \ 561886f67eSGordon Ross >> struct_layout_$(ARCH).tmp 57fc01d378SGordon Ross @diff -u struct_layout_$(ARCH).tmp \ 581886f67eSGordon Ross ../common/struct_layout_$(ARCH).c ||\ 591886f67eSGordon Ross { echo "Error: struct_layout_$(ARCH).c needs update!" ; exit 1; } 60fc01d378SGordon Ross touch $@ 611886f67eSGordon Ross 621886f67eSGordon Ross# We need CTF data in this object. 631886f67eSGordon Rossgen_layout_obj.o := CFLAGS += $(CTF_FLAGS) 641886f67eSGordon Rossgen_layout_obj.o := CFLAGS64 += $(CTF_FLAGS) 651886f67eSGordon Rossgen_layout_obj.o := POST_PROCESS_O = $(CTFCONVERT_O) 661886f67eSGordon Ross 671886f67eSGordon Rossgen_struct_layout: ../common/gen_struct_layout.c 68*7f11fd00SRichard Lowe $(NATIVECC) $(NATIVE_CFLAGS) -o $@ \ 691886f67eSGordon Ross ../common/gen_struct_layout.c -lctf 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gateclean: 721886f67eSGordon Ross $(RM) $(OBJS) $(CLEANFILES) gen_struct_layout \ 731886f67eSGordon Ross check_struct_layout gen_layout_obj.o \ 741886f67eSGordon Ross struct_layout_$(ARCH).tmp 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gatedelete: 777c478bd9Sstevel@tonic-gate $(RM) $(PROG) 787c478bd9Sstevel@tonic-gate 7967298654Sdamicopackage \ 8067298654Sdamicoinstall: all $(VAR_SGSBINPROG) $(VAR_SGSCCSLINK) 817c478bd9Sstevel@tonic-gate 825aefb655Srie.PARALLEL: $(LINTOUT32) $(LINTOUT64) 835aefb655Srie 845aefb655Srielint: $(LINTOUT32) $(LINTOUT64) $(SGSLINTOUT) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/Makefile.targ 877c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/sgs/Makefile.targ 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate# Derived source and header files (messaging). 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gatecatalog: $(BLTMESG) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gatechkmsg: $(SRCS) 947c478bd9Sstevel@tonic-gate sh $(CHKMSG) $(CHKMSGFLAGS) $(SRCS) 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate$(BLTDEFS) + \ 977c478bd9Sstevel@tonic-gate$(BLTDATA) + \ 987c478bd9Sstevel@tonic-gate$(BLTMESG): $(SGSMSGALL) 997c478bd9Sstevel@tonic-gate $(SGSMSG) $(SGSMSGFLAGS) $(SGSMSGALL) 100