xref: /illumos-gate/usr/src/cmd/ast/tools/Makefile (revision a8e6450f)
1b30d1939SAndy Fiddaman#
2b30d1939SAndy Fiddaman# This file and its contents are supplied under the terms of the
3b30d1939SAndy Fiddaman# Common Development and Distribution License ("CDDL"), version 1.0.
4b30d1939SAndy Fiddaman# You may only use this file in accordance with the terms of version
5b30d1939SAndy Fiddaman# 1.0 of the CDDL.
6b30d1939SAndy Fiddaman#
7b30d1939SAndy Fiddaman# A full copy of the text of the CDDL should have accompanied this
8b30d1939SAndy Fiddaman# source.  A copy of the CDDL is also available via the Internet at
9b30d1939SAndy Fiddaman# http://www.illumos.org/license/CDDL.
10b30d1939SAndy Fiddaman#
11b30d1939SAndy Fiddaman
12b30d1939SAndy Fiddaman#
13b30d1939SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
14b30d1939SAndy Fiddaman#
15b30d1939SAndy Fiddaman
16475b46feSAndy FiddamanSHELL= /usr/bin/ksh93
17475b46feSAndy Fiddaman
18*a8e6450fSAndy FiddamanCTOOLS= proto lcgen
19*a8e6450fSAndy FiddamanSHTOOLS= iffe package gentab
20b30d1939SAndy Fiddaman
21b30d1939SAndy FiddamanTOOLS= $(CTOOLS) $(SHTOOLS) probe
22b30d1939SAndy FiddamanOBJS= $(CTOOLS:%=%.o)
23b30d1939SAndy Fiddaman
24b30d1939SAndy Fiddamaninclude $(SRC)/cmd/Makefile.cmd
25b30d1939SAndy Fiddamaninclude ../Makefile.ast
26b30d1939SAndy Fiddaman
27b30d1939SAndy FiddamanCC= $(NATIVECC)
28b30d1939SAndy FiddamanLD= $(NATIVELD)
29b30d1939SAndy FiddamanCFLAGS= $(NATIVE_CFLAGS)
30b30d1939SAndy Fiddaman
31b30d1939SAndy Fiddamanall install install_h: $(TOOLS)
32b30d1939SAndy Fiddaman_msg _feature:
33b30d1939SAndy Fiddaman
34b30d1939SAndy Fiddamanclean clobber:
35b30d1939SAndy Fiddaman	$(RM) $(OBJS) $(TOOLS)
36b30d1939SAndy Fiddaman
37475b46feSAndy Fiddamanpackage:
38b30d1939SAndy Fiddaman	$(RM) $@
39b30d1939SAndy Fiddaman	# The string returned by 'package' must match the value used by
40b30d1939SAndy Fiddaman	# AT&T upstream, which is "i386" or "sun4", regardless of whether
41b30d1939SAndy Fiddaman	# building 32- or 64-bit objects.
42b30d1939SAndy Fiddaman	{ \
43b30d1939SAndy Fiddaman		print "#!/bin/sh"; \
44b30d1939SAndy Fiddaman		[[ $(MACH) == i386 ]] && arch=i386 || arch=sun4; \
45b30d1939SAndy Fiddaman		print "echo sol11.$$arch"; \
46b30d1939SAndy Fiddaman	} >; $@
47b30d1939SAndy Fiddaman	$(CHMOD) +x $@
48b30d1939SAndy Fiddaman
49b30d1939SAndy Fiddaman%.o: $(C_ASTINIT)/%.c
50b30d1939SAndy Fiddaman	$(COMPILE.c) -o $@ $<
51b30d1939SAndy Fiddaman	$(POST_PROCESS_O)
52b30d1939SAndy Fiddaman
53b30d1939SAndy Fiddaman%.o: $(C_AST)/src/lib/libast/port/%.c
54b30d1939SAndy Fiddaman	$(COMPILE.c) -o $@ $<
55b30d1939SAndy Fiddaman	$(POST_PROCESS_O)
56b30d1939SAndy Fiddaman
57b30d1939SAndy Fiddaman%: $(C_ASTINIT)/%.sh
58b30d1939SAndy Fiddaman	$(RM) $@
59b30d1939SAndy Fiddaman	{ \
60b30d1939SAndy Fiddaman		echo 'USAGE_LICENSE="[-author?ATT]"'; \
61b30d1939SAndy Fiddaman		cat $<; \
62b30d1939SAndy Fiddaman	} >; $@
63b30d1939SAndy Fiddaman	$(CHMOD) +x $@
64b30d1939SAndy Fiddaman
65b30d1939SAndy Fiddaman%: $(C_AST)/src/lib/libpp/%.sh
66b30d1939SAndy Fiddaman	$(RM) $@
67b30d1939SAndy Fiddaman	{ \
68b30d1939SAndy Fiddaman		echo 'USAGE_LICENSE="[-author?ATT]"'; \
69b30d1939SAndy Fiddaman		cat $<; \
70b30d1939SAndy Fiddaman	} >; $@
71b30d1939SAndy Fiddaman	$(CHMOD) +x $@
72b30d1939SAndy Fiddaman
73b30d1939SAndy Fiddaman$(CTOOLS): $(OBJS)
74b30d1939SAndy Fiddaman	$(LINK.c) $@.o -o $@ $(LDLIBS)
75b30d1939SAndy Fiddaman	$(POST_PROCESS)
76b30d1939SAndy Fiddaman
77b30d1939SAndy Fiddamanprobe: $(C_ASTINIT)/C+probe $(C_ASTINIT)/make.probe
78b30d1939SAndy Fiddaman	$(CAT) $(C_ASTINIT)/C+probe $(C_ASTINIT)/make.probe > $@
79b30d1939SAndy Fiddaman	$(CHMOD) +x $@
80b30d1939SAndy Fiddaman
81b30d1939SAndy FiddamanSTACKPROTECT= none
82b30d1939SAndy Fiddaman
83b30d1939SAndy FiddamanCERRWARN += -_gcc=-Wno-parentheses
84b30d1939SAndy FiddamanCERRWARN += -_gcc=-Wno-implicit-fallthrough
85b30d1939SAndy FiddamanCERRWARN += -_gcc=-Wno-unused-value
86b30d1939SAndy FiddamanCERRWARN += $(CNOWARN_UNINIT)
87b30d1939SAndy FiddamanSMATCH= off
88b30d1939SAndy Fiddaman
89475b46feSAndy Fiddaman.KEEP_STATE:
90b30d1939SAndy Fiddaman.PARALLEL: $(TOOLS)
91