xref: /illumos-gate/usr/src/cmd/ast/libdll/Makefile.com (revision 44ce9f4b)
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= libdll.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 -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:
53#   - "-D_BLD_DLL" comes from ${mam_cc_DLL} in Mamfile
54CPPFLAGS= \
55	$(DTEXTDOM) $(DTS_ERRNO) \
56	$(DLLPLATFORMCPPFLAGS) \
57	-Iast -I. \
58	-I$(ROOT)/usr/include/ast \
59	-I$(ROOT)/usr/include \
60	'-DCONF_LIBSUFFIX=".so"' \
61	'-DCONF_LIBPREFIX="lib"' \
62	-D_PACKAGE_ast \
63	-D_BLD_DLL \
64	-D_BLD_dll
65
66CFLAGS += $(ASTCFLAGS)
67CFLAGS64 += $(ASTCFLAGS64)
68
69CERRWARN	+= -_gcc=-Wno-parentheses
70CERRWARN	+= $(CNOWARN_UNINIT)
71
72# needs work
73SMOFF += all_func_returns,strcpy_overflow
74
75.KEEP_STATE:
76
77all: install_h .WAIT $(LIBS)
78
79include $(SRC)/lib/Makefile.targ
80
81pics/%.o: $(ASTSRC)/%.c
82	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
83	$(POST_PROCESS_O)
84
85######################################################################
86# Header file generation
87
88$(HEADERGEN:%=ast/%): $(FEATURES:%=FEATURE/%)
89	$(MKDIR) -p $(@D)
90	src=`echo $(@F:%.h=%) | sed 's/^ast_//'`; \
91	    [[ $$src = dlldefs ]] && src=dll; \
92	    $(AST_PROTO) FEATURE/$$src > $@
93	$(POST_PROCESS_AST)
94
95install_h: $(HEADERGEN:%=ast/%)
96
97CLOBBERFILES += ast/*
98
99_feature: FRC
100	$(MAKE) -f Makefile.iffe generate
101
102include ../../Makefile.astmsg
103
104FRC:
105