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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24#
25
26SHELL=/usr/bin/ksh93
27
28LIBRARY=	libshell.a
29VERS=		.1
30
31OBJECTS= \
32	bltins/alarm.o \
33	bltins/cd_pwd.o \
34	bltins/cflow.o \
35	bltins/enum.o \
36	bltins/getopts.o \
37	bltins/hist.o \
38	bltins/misc.o \
39	bltins/poll_solaris.o \
40	bltins/print.o \
41	bltins/read.o \
42	bltins/regress.o \
43	bltins/shiocmd_solaris.o \
44	bltins/sleep.o \
45	bltins/test.o \
46	bltins/trap.o \
47	bltins/typeset.o \
48	bltins/ulimit.o \
49	bltins/umask.o \
50	bltins/whence.o \
51	data/aliases.o \
52	data/builtins.o \
53	data/keywords.o \
54	data/lexstates.o \
55	data/limits.o \
56	data/msg.o \
57	data/options.o \
58	data/signals.o \
59	data/strdata.o \
60	data/testops.o \
61	data/variables.o \
62	edit/completion.o \
63	edit/edit.o \
64	edit/emacs.o \
65	edit/hexpand.o \
66	edit/history.o \
67	edit/vi.o \
68	sh/args.o \
69	sh/arith.o \
70	sh/array.o \
71	sh/defs.o \
72	sh/deparse.o \
73	sh/expand.o \
74	sh/fault.o \
75	sh/fcin.o \
76	sh/init.o \
77	sh/io.o \
78	sh/jobs.o \
79	sh/lex.o \
80	sh/macro.o \
81	sh/main.o \
82	sh/name.o \
83	sh/nvdisc.o \
84	sh/nvtree.o \
85	sh/nvtype.o \
86	sh/parse.o \
87	sh/path.o \
88	sh/streval.o \
89	sh/string.o \
90	sh/subshell.o \
91	sh/tdump.o \
92	sh/timers.o \
93	sh/trestore.o \
94	sh/waitevent.o \
95	sh/xec.o
96
97# We are storing the object files into subdirs avoid the
98# confusion with having too many object files in the toplevel pics/
99# directory (this matches the way how the original AST build system
100# deals with this "logistic" issue) - the rules below ensure that
101# the destination directory is available.
102OBJDIRS =  \
103	bltins \
104	data \
105	edit \
106	sh
107PICSDIRS= $(OBJDIRS:%=pics/%)
108mkpicdirs:
109	@mkdir -p $(PICSDIRS)
110	
111# Specify the MACH we currently use to build and test ksh
112LIBSHELLMACH= $(TARGETMACH)
113LIBSHELLBASE=..
114	
115include ../../Makefile.astmsg
116
117include ../../Makefile.lib
118
119# mapfile-vers does not live with the sources in in common/ to make
120# automated code updates easier.
121MAPFILES=       ../mapfile-vers
122
123# Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
124include ../../../Makefile.ast
125
126LIBS =		$(DYNLIB) $(LINTLIB)
127
128LDLIBS += \
129	-lcmd \
130	-ldll \
131	-last \
132	-lsocket \
133	-lm \
134	-lc
135
136$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
137
138SRCDIR =	../common
139
140# 1. Make sure that the -D/-U defines in CPPFLAGS below are in sync
141# with usr/src/cmd/ksh/Makefile.com
142# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
143# case - it MUST come as the last element but future changes in -D options
144# may then cause silent breakage in the AST sources because the last -D
145# option specified overrides previous -D options so we prefer the current
146# way to explicitly list each single flag.
147CPPFLAGS = \
148	$(DTEXTDOM) $(DTS_ERRNO) \
149	$(LIBSHELLCPPFLAGS)
150
151CFLAGS += \
152	$(ASTCFLAGS)
153CFLAGS64 += \
154	$(ASTCFLAGS64)
155
156pics/sh/macro.o		:= CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
157pics/sh/nvdisc.o	:= CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED
158
159.KEEP_STATE:
160
161all: mkpicdirs .WAIT $(LIBS)
162
163#
164# libshell is not lint-clean yet; fake up a target.  (You can use
165# "make lintcheck" to actually run lint; please send all lint fixes
166# upstream (to AT&T) so the next update will pull them into ON.)
167#
168lint:
169	@ print "usr/src/lib/libshell is not lint-clean: skipping"
170
171include ../../Makefile.targ
172