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 2021 OmniOS Community Edition (OmniOSce) Association. 27 28SHELL= /usr/bin/ksh93 29 30include ../../Makefile.cmd 31$(SPARC_BLD)include ../../Makefile.cmd.64 32 33.KEEP_STATE: 34 35# Set common AST build flags (e.g., needed to support the math stuff). 36include ../Makefile.ast 37 38OBJECTS= shcomp.o 39 40ASTSRC= $(C_AST)/src/cmd/ksh93 41LIBSHELLMACH= $(MACH) 42LIBSHELLBASE= ../libshell 43LIBSHELLSRC= $(ASTSRC)/sh 44 45SRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c) 46 47LDLIBS += -lshell -last 48 49# We use "=" here since using $(CPPFLAGS.master) is very tricky in our 50# case - it MUST come as the last element but future changes in -D options 51# may then cause silent breakage in the AST sources because the last -D 52# option specified overrides previous -D options so we prefer the current 53# way to explicitly list each single flag. 54CPPFLAGS= \ 55 $(DTEXTDOM) $(DTS_ERRNO) \ 56 $(LIBSHELLCPPFLAGS) 57 58CFLAGS += $(ASTCFLAGS) 59CFLAGS64 += $(ASTCFLAGS64) 60 61CERRWARN += -_gcc=-Wno-parentheses 62 63ROOTCMDDIR=$(ROOT)/usr/bin 64 65PROG= shcomp 66 67%.o: $(LIBSHELLSRC)/%.c 68 $(COMPILE.c) -c -o $@ $< 69 $(POST_PROCESS_O) 70 71all: $(PROG) 72 73# dummy file since AST/ksh/shcomp doesn't use *.po files 74# (and "shcomp" is just a frontend which calls directly into libshell, 75# i.e. there are no l10n strings here) 76$(PROG).po: 77 $(RM) $(PROG).po ; \ 78 $(TOUCH) $(PROG).po 79 80install: all $(ROOTCMD) 81install_h _feature: 82 83$(PROG): $(OBJECTS) 84 $(RM) shcomp 85 $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS) 86 $(POST_PROCESS) 87 88clean: 89 $(RM) $(OBJECTS) 90 91include ../../Makefile.targ 92