2007-06-04 23:55:38 +02:00
|
|
|
# $MirOS: src/bin/mksh/Makefile,v 1.41 2007/06/04 21:55:38 tg Exp $
|
• remove strcasestr.c, use home-grown implementation¹, call it stricmp,
and have it return an API-correct const char *
• enhance and stylify comments
• a little KNF and simplifications
• #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr
that take and return a non-const char *, and fix the violations
• new cstrchr, cstrstr (take and give const char *)
• new vstrchr, vstrstr (take const or not, give boolean value)
• new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP)
• new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-")
• replace the only use of strrchr with inlined code to shrink
• minor man page fixes
• Minix 3 signames are autogenerated with gcc
• rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway,
only strlcpy(3), and shorten it
• dot.mkshrc: move MKSH=… down to the export line
to not disturb the PS1 visual impression ☺
• dot.mkshrc: Lstripcom(): optimise
• bump version
¹) side effect from creating API-correct cstrchr, cstrstr, etc.
uses goto so it must be better ☻
tested on mirbsd-current via both Makefile and Build.sh
2007-03-04 04:04:28 +01:00
|
|
|
#-
|
|
|
|
# use CPPFLAGS=-DDEBUG __CRAZY=Yes to check for certain more stuff
|
2007-02-18 17:24:13 +01:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
2005-05-23 05:06:10 +02:00
|
|
|
|
|
|
|
PROG= mksh
|
|
|
|
SRCS= alloc.c edit.c eval.c exec.c expr.c funcs.c histrap.c \
|
|
|
|
jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c
|
2007-01-18 02:24:46 +01:00
|
|
|
.if !make(test-build)
|
2007-02-18 17:24:13 +01:00
|
|
|
CPPFLAGS+= -DMKSH_ASSUME_UTF8 \
|
|
|
|
-DHAVE_ATTRIBUTE=1 -DHAVE_ATTRIBUTE_BOUNDED=1 \
|
2007-01-18 02:24:46 +01:00
|
|
|
-DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_PARAM_H=1 \
|
2007-03-04 05:36:45 +01:00
|
|
|
-DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_MMAN_H=1 \
|
|
|
|
-DHAVE_SYS_SYSMACROS_H=0 -DHAVE_LIBGEN_H=1 -DHAVE_PATHS_H=1 \
|
|
|
|
-DHAVE_STDBOOL_H=1 -DHAVE_STDINT_H=1 -DHAVE_GRP_H=1 \
|
|
|
|
-DHAVE_ULIMIT_H=0 -DHAVE_VALUES_H=0 -DHAVE_RLIM_T=1 \
|
|
|
|
-DHAVE_SIG_T=1 -DHAVE_MKSH_SIGNAME=0 -DHAVE_SYS_SIGNAME=1 \
|
|
|
|
-DHAVE__SYS_SIGNAME=0 -DHAVE_SYS_SIGLIST=1 -DHAVE_STRSIGNAL=0 \
|
2007-04-24 12:42:02 +02:00
|
|
|
-DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_PUSH=1 \
|
|
|
|
-DHAVE_FLOCK_EX=1 -DHAVE_SETLOCALE_CTYPE=0 \
|
|
|
|
-DHAVE_LANGINFO_CODESET=0 -DHAVE_REVOKE=1 -DHAVE_SETMODE=1 \
|
|
|
|
-DHAVE_SETRESUGID=1 -DHAVE_SETGROUPS=1 -DHAVE_STRCASESTR=1 \
|
|
|
|
-DHAVE_STRLCPY=1 -DHAVE_ARC4RANDOM_DECL=1 \
|
2007-06-04 23:55:38 +02:00
|
|
|
-DHAVE_ARC4RANDOM_PUSH_DECL=1 -DHAVE_SYS_SIGLIST_DECL=1 \
|
|
|
|
-DHAVE_PERSISTENT_HISTORY=1
|
2007-02-18 17:24:13 +01:00
|
|
|
COPTS+= -std=gnu99 -Wall
|
2007-01-18 02:24:46 +01:00
|
|
|
.endif
|
2005-05-23 05:06:10 +02:00
|
|
|
|
2006-07-23 21:10:59 +02:00
|
|
|
LINKS+= ${BINDIR}/${PROG} ${BINDIR}/sh
|
|
|
|
MLINKS+= ${PROG}.1 sh.1
|
|
|
|
|
2005-05-23 05:06:10 +02:00
|
|
|
regress: ${PROG} check.pl check.t
|
2007-01-12 02:11:03 +01:00
|
|
|
-rm -rf regress-dir
|
2006-05-08 14:18:49 +02:00
|
|
|
mkdir -p regress-dir
|
|
|
|
echo export FNORD=666 >regress-dir/.mkshrc
|
|
|
|
HOME=$$(readlink -nf regress-dir) perl ${.CURDIR}/check.pl \
|
2006-08-01 14:46:01 +02:00
|
|
|
-s ${.CURDIR}/check.t -v -p ./${PROG} -C pdksh
|
2006-05-08 14:18:49 +02:00
|
|
|
|
2007-01-18 02:24:46 +01:00
|
|
|
test-build: .PHONY
|
|
|
|
-rm -rf build-dir
|
|
|
|
mkdir -p build-dir
|
|
|
|
cd build-dir; env CC=${CC:Q} CFLAGS=${CFLAGS:M*:Q} \
|
|
|
|
CPPFLAGS=${CPPFLAGS:M*:Q} LDFLAGS=${LDFLAGS:M*:Q} \
|
|
|
|
LIBS= NOWARN=-Wno-error TARGET_OS= CPP= /bin/sh \
|
2007-05-24 11:06:31 +02:00
|
|
|
${.CURDIR}/Build.sh -r && ./test.sh -v
|
2006-05-08 14:18:49 +02:00
|
|
|
|
2007-01-18 02:24:46 +01:00
|
|
|
cleandir: clean-extra
|
|
|
|
|
|
|
|
clean-extra: .PHONY
|
|
|
|
-rm -rf build-dir regress-dir
|
2005-05-23 05:06:10 +02:00
|
|
|
|
2007-04-16 20:54:37 +02:00
|
|
|
distribution:
|
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${CONFGRP} -m 0644 \
|
|
|
|
${.CURDIR}/dot.mkshrc ${DESTDIR}/etc/skel/.mkshrc
|
|
|
|
|
2005-05-23 05:06:10 +02:00
|
|
|
.include <bsd.prog.mk>
|