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