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# Copyright (c) 2019, Joyent, Inc. 25# Copyright 2021 OmniOS Community Edition (OmniOSce) Association. 26# 27 28SHELL= /usr/bin/ksh93 29 30LIBRARY= libshell.a 31VERS= .1 32 33include ../Makefile.defs 34 35OBJECTS += $(LIBOBJS) 36 37include $(SRC)/lib/Makefile.lib 38include ../../Makefile.ast 39 40MAPFILES= ../mapfile-vers 41 42# Specify the MACH we currently use to build and test ksh 43LIBSHELLMACH= $(TARGETMACH) 44LIBSHELLBASE=.. 45 46LIBS= $(DYNLIB) 47LDLIBS += -lcmd -ldll -last -lsocket -lm -lc 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 -Iast -I. 58 59CFLAGS += $(ASTCFLAGS) 60CFLAGS64 += $(ASTCFLAGS64) 61 62CERRWARN += -_gcc=-Wno-parentheses 63CERRWARN += -_gcc=-Wno-unused-value 64CERRWARN += -_gcc=-Wno-unused-variable 65CERRWARN += -_gcc=-Wno-unused-function 66CERRWARN += $(CNOWARN_UNINIT) 67CERRWARN += -_gcc=-Wno-clobbered 68CERRWARN += -_gcc=-Wno-char-subscripts 69 70pics/bltins/print.o := CERRWARN += -_gcc14=-Wno-dangling-pointer 71pics/bltins/print.o := CERRWARN += -_gcc15=-Wno-dangling-pointer 72 73# smatch gets out of memory on common/sh/macro.c 74SMATCH= off 75 76.KEEP_STATE: 77 78all: install_h mkpicdirs .WAIT $(LIBS) 79 80mkpicdirs: 81 @mkdir -p $(LOBJDIRS:%=pics/%) 82 83include $(SRC)/lib/Makefile.targ 84 85pics/%.o: $(ASTSRC)/%.c 86 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< 87 $(POST_PROCESS_O) 88 89###################################################################### 90# Header file generation 91 92$(HEADERSRC:%=ast/%): $(HEADERSRC:%=$(ASTSRC)/include/%) 93 $(MKDIR) -p $(@D) 94 $(CP) $(ASTSRC)/include/$(@F) $@ 95 96CLOBBERFILES += ast/* 97 98install_h: $(HEADERSRC:%=ast/%) 99 100_feature: FRC 101 $(MAKE) -f Makefile.iffe generate 102 103include ../../Makefile.astmsg 104 105FRC: 106