Makefile revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/*
*/
VERSION = 1.1
ERROR_CONTEXT_T == Error_context_t /* workaround until switch from errorpush()/errorpop() => errorctx() */
/*
*/
SHOPT_ACCT == /* accounting */
SHOPT_RAWONLY == 1 /* make viraw the only vi mode */
SHOPT_REGRESS == /* enable __regress__ builtin and instrumented intercepts for testing */
SHOPT_REMOTE == /* enable --rc if running as a remote shell */
SHOPT_SEVENBIT == /* strip the eigth bit from characters */
SHOPT_STATS == 1 /* add .sh.stats variable */
SHOPT_TIMEOUT == /* number of seconds for shell timeout */
SHOPT_TYPEDEF == 1 /* enable typeset type definitions */
SHOPT_VSH == 1 /* vi edit mode */
if CC.HOSTTYPE == "linux.alpha"
/* workaround for "BUG IN DYNAMIC LINKER ld.so" */
:PACKAGE: - m:static:noinclude /*noCC.EXPORT.DYNAMIC*/
end
if CC.HOSTTYPE == "*.s390-64"
end
if SHOPT_DYNAMIC && ( "$(CC.DIALECT:N=EXPORT=DLL)" || "$(PACKAGE_OPTIONS:N=optimize-space)" )
if "$(PACKAGE_OPTIONS:N=optimize-space)" && ! SHOPT_CMDLIB_HDR
SHOPT_CMDLIB_HDR == <cmdlist.h>
end
CCFLAGS += $$(CC.DLL) $$(CC.SUFFIX.DEBUG:+$$(CC.DEBUG))
LIBS_req = -lshell$(RELEASE)
else
if VARIANT
SHOPT_DYNAMIC = 1
else
libtype = :static
end
if SHOPT_DYNAMIC
CCLDFLAGS += $$(CC.EXPORT.DYNAMIC)
end
LIBS_req = +lshell$(RELEASE)
end
:PACKAGE: ast$(libtype):20100309 coshell:order --clobber=!($(SH))
.SOURCE : edit sh bltins data tests fun
.SOURCE.h : include
/* documentation files */
DOCFILES = sh.memo builtins.mm README RELEASE TYPES PROMO.mm COMPATIBILITY \
DESIGN OBSOLETE RELEASE93 RELEASE88
KSHELL == 1 /* this is ksh */
SH_CMDLIB_DIR == /* SHOPT_CMDLIB_DIR dir prefix */
SH_DICT == /* message catalog */
DEBUG == /* debugging purposes only */
if CC.HOSTTYPE == "win32*"
SHOPT_CRNL == 1 /* <cr><nl> is eqivalent to <nl> */
end
if SHOPT_BASH
BASH_HOSTTYPE == "$(CC.HOSTTYPE:S:/\.//)"
BASH_MACHTYPE == "$(BASH_HOSTTYPE)-unknown-$(CC.HOSTTYPE:B)"
end
/* use the following libraries only if they exist */
LIBS_opt := +ljobs +li
if CC.HOSTTYPE == "sol([89]|[1-9][0-9]).*"
LDFLAGS += $(CC.LD.LAZY) $(CC.LD.NORECORD)
end
if "$(-mam:N=static*)"
LIBS_opt += -lsocket -lnsl
elif CC.HOSTTYPE == "sol?([789]|[1-9][0-9]).*"
LIBS_opt += +lsocket -lnsl
elif CC.HOSTTYPE != "sgi.mips*"
LIBS_opt += +lsocket +lnsl
end
if CC.HOSTTYPE == "linux.sparc*"
/* the linux.sparc linker still has some problems */
LIBS_opt += -ldll
end
LIBS_opt += -lsecdb
if CC.HOSTTYPE == "sol.*"
LIBS_opt += -lw
end
$(LIBS_opt) : .DONTCARE
LDLIBRARIES = $(LIBS_opt)
FILES_opt = /* optional file list enabled by vars above */
if SHOPT_ESH
FILES_opt += emacs.c
end
if SHOPT_VSH
FILES_opt += vi.c
end
if SHOPT_BASH
FILES_opt += bash.c bash_pre_rc.c
SHOPT_HISTEXPAND == 1
end
if SHOPT_HISTEXPAND
FILES_opt += hexpand.c
end
if SHOPT_DYNAMIC
FILES_opt += -ldll
end
if SHOPT_X
end
:ALL: $(SH) $(SHCOMP) $(SHOPT_SUID_EXEC:+suid_exec) $(SHOPT_BASH:+bash$(RELEASE))
$(SH) :: sh.1 pmain.c $(LIBS_req)
trestore.c waitevent.c xec.c env.c $(DATAFILES) $(FILES_opt) \
$(SHOPT_COSHELL:+-lcoshell) -lcmd -last -lm
"sol*.i386*" :NOOPTIMIZE: main.c
"win32*" :NOOPTIMIZE: strdata.c trestore.c
if CC.HOSTTYPE == "win32*"
:DLL: $(CC.DEBUG)
else
:DLL: $(CC.OPTIMIZE)
end
:READONLY: $(DATAFILES)
LIBCMD = $(.LIB.NAME. cmd:T=F)
if SHOPT_SUID_EXEC && ! "$(RELEASE)"
suid_exec :: CC.DLL= suid_exec.c +last
end
$(FUNDIR) :INSTALLDIR: mode=+x dirs popd pushd
shcomp.o : _BLD_DLL= $(CC.HOSTTYPE:N=cygwin.*:??_BLD_shell=?)
if SHOPT_BASH
bash$(RELEASE) :LINK: $(SH)
echo "const char bash_pre_rc[] = " > $(<)
sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/'"'"'/\\'"'"'/g' -e 's/^[[:space:]]*\(.*\)$/\"\1\\n\"/' $(*) >> $(<)
echo ";" >> $(<)
end
:: math.tab syscall.s mamexec mamstate.c $(DOCFILES) \
:: shtests \
recttype.sh restricted.sh return.sh select.sh shtests \
if "$(PWD:B:N=cc-*)"
test : .NULL
else
test : test.ksh
test.ksh : $(BINDIR)/$(SH) $(SH) shtests
echo "make install to run the tests on the latest $(SH)" >&2
cd $(*:O=3:P=L!:D)
SHELL=$(*:O=1:P=A) $(*:O=1:P=A) $(*:O=3:B) $(SHTESTSFLAGS)
test.% : %.sh COSHELL_OPTIONS=separate $(BINDIR)/$(SH) $(SH) shtests
echo "make install to run the tests on the latest $(SH)" >&2
cd $(*:O=4:P=L!:D)
SHELL=$(*:O=2:P=A) $(*:O=2:P=A) $(*:O=4:B) $(SHTESTSFLAGS) $(*:O=1:P=A)
if RELEASE
.INSTALL : .CLEAR $(*.INSTALL:N=*$(RELEASE)*([!/]))
end
end