xref: /illumos-gate/usr/src/cmd/ast/ksh/builtins/Makefile (revision b30d1939)
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 2010 Nexenta Systems, Inc.  All rights reserved.
27# Copyright (c) 2018, Joyent, Inc.
28# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
29#
30
31PROG= alias
32ALIASPROG= \
33	bg \
34	cd \
35	cksum \
36	cmp \
37	comm \
38	command \
39	cut \
40	fc \
41	fg \
42	getopts \
43	hash \
44	jobs \
45	join \
46	kill \
47	logname \
48	paste \
49	print \
50	read \
51	rev \
52	sum \
53	tee \
54	test \
55	type \
56	ulimit \
57	umask \
58	unalias \
59	uniq \
60	wait \
61	wc
62
63XPG4ALIASPROG= \
64	alias \
65	bg \
66	cd \
67	command \
68	fc \
69	fg \
70	getopts \
71	hash \
72	jobs \
73	kill \
74	read \
75	test \
76	type \
77	ulimit \
78	umask \
79	unalias \
80	wait
81
82XPG4SH= \
83	sh
84
85ROOTXPG4ALIAS= \
86	$(XPG4SH:%=$(ROOTXPG4BIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
87ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
88
89include ../../../Makefile.cmd
90$(SPARC_BLD)include ../../../Makefile.cmd.64
91
92FILEMODE= 555
93CERRWARN += -_gcc=-Wno-parentheses
94
95# not linted
96SMATCH=off
97
98.KEEP_STATE:
99
100all: $(PROG)
101
102$(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%):
103	$(RM) $@; $(SYMLINK) ../../bin/alias $@
104
105$(XPG4SH:%=$(ROOTXPG4BIN)/%):
106	$(RM) $@; $(SYMLINK) ../../bin/ksh93 $@
107
108$(ALIASPROG:%=$(ROOTBIN)/%): $(ROOTPROG)
109	$(RM) $@; $(LN) $(ROOTPROG) $@
110
111.KEEP_STATE:
112
113# Set common AST build flags (e.g., needed to support the math stuff).
114include ../../Makefile.ast
115
116
117ASTSRC= $(C_AST)/src/cmd/ksh93
118
119OBJECTS= \
120        alias.o
121
122SRCS=	$(OBJECTS:%.o=%.c)
123
124LDLIBS += -lshell -lcmd -last -lumem
125
126CPPFLAGS= \
127	$(DTEXTDOM) $(DTS_ERRNO) \
128	-I$(ASTSRC)/include \
129	-I$(AST)/libshell/$(MACH) \
130	-I$(ROOT)/usr/include/ast \
131	-I$(ROOT)/usr/include
132
133CFLAGS += $(ASTCFLAGS)
134CFLAGS64 += $(ASTCFLAGS64)
135
136ROOTCMDDIR=$(ROOT)/usr/bin
137
138install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTALIASPROG) $(ROOTXPG4ALIAS)
139
140$(PROG):	$(OBJECTS)
141	$(RM) alias
142	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
143	$(POST_PROCESS)
144
145clean clobber:
146	rm -f $(PROG) $(OBJECTS)
147
148_msg:
149