xref: /illumos-gate/usr/src/cmd/ast/libsum/Makefile.com (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright (c) 2018, Joyent, Inc.
27# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
28
29SHELL= /usr/bin/ksh93
30
31LIBRARY= libsum.a
32VERS= .1
33
34include ../Makefile.defs
35
36OBJECTS += $(LIBOBJS)
37
38include $(SRC)/lib/Makefile.lib
39include ../../Makefile.ast
40
41MAPFILES= ../mapfile-vers
42
43LIBS= $(DYNLIB)
44
45LDLIBS += -last -lmd -lc
46
47# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
48# case - it MUST come as the last element but future changes in -D options
49# may then cause silent breakage in the AST sources because the last -D
50# option specified overrides previous -D options so we prefer the current
51# way to explicitly list each single flag.
52# Notes:
53CPPFLAGS= \
54	$(DTEXTDOM) $(DTS_ERRNO) \
55	-Iast -I. \
56	-I$(ROOT)/usr/include/ast \
57	-I$(ROOT)/usr/include \
58	-D_PACKAGE_ast \
59	-D_BLD_DLL
60
61CFLAGS += $(ASTCFLAGS)
62CFLAGS64 += $(ASTCFLAGS64)
63
64CERRWARN += -_gcc=-Wno-parentheses
65
66SMOFF += all_func_returns
67
68.KEEP_STATE:
69
70# This codepath is performance-critical
71sparc_COPTFLAG = -xO5
72sparcv9_COPTFLAG = $(sparc_COPTFLAG)
73i386_COPTFLAG =
74amd64_COPTFLAG = $(i386_COPTFLAG)
75
76all: install_h .WAIT $(LIBS)
77
78include $(SRC)/lib/Makefile.targ
79
80pics/%.o: $(ASTSRC)/%.c
81	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
82	$(POST_PROCESS_O)
83
84######################################################################
85# Header file generation
86
87$(HEADERSRC:%=ast/%): $(HEADERSRC:%=$(ASTSRC)/%)
88	$(MKDIR) -p $(@D)
89	$(CP) $(ASTSRC)/$(@F) $@
90
91install_h: $(HEADERSRC:%=ast/%)
92
93CLOBBERFILES += ast/*
94
95_feature: FRC
96	$(MAKE) -f Makefile.iffe generate
97
98include ../../Makefile.astmsg
99
100FRC:
101