# $OpenBSD: Makefile,v 1.8 2005/05/24 22:25:46 millert Exp $ # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria # # To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile. # Patch over a misfeature in the bsd.prog.mk that comes with the BSD # make installed by at least one version of Linux. (It sets CFLAGS to # -O2 -fno-strict-aliasing -pipe, leaving no sane way to just turn off # optimization - to turn off -O2 you have to replace CFLAGS, meaning # you have to either somehow divine what other options are in it or be # willing to trash them willy-nilly. Fortunately, the former is # relatively easy. Mercifully, it sets it with ?=, so we can define # it here and not get it trashed by bsd.prog.mk.) CFLAGS = -O0 -fno-strict-aliasing -pipe MCSH_VERSION=2.0.20-linux PROG= csh DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS DFLAGS+=-D_GNU_SOURCE -D__BSD_VISIBLE CFLAGS+=-g #CFLAGS+=-Wall CFLAGS+=-I${.CURDIR} -I. ${DFLAGS} SRCS= alloc.c char.c const.c csh.c dir.c dol.c error.c exec.c exp.c file.c \ func.c glob.c hist.c init.c lex.c misc.c parse.c proc.c \ sem.c set.c str.c time.c \ ecl-glue.c ecl-path.c ecl-malloc.c ecl.c version.c SRCS+= _glob.c _strlcpy.c _vis.c MLINKS= csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \ csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \ csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \ csh.1 stop.1 csh.1 source.1 csh.1 unlimit.1 CLEANFILES+=error.h const.h version.c:: echo 'char mcsh_version[] = "'"$(MCSH_VERSION)"'";' > version.c CLEANFILES += version.c .if (${MACHINE_ARCH} == "vax") alloc.o: ${CC} ${CFLAGS} ${CPPFLAGS} -O0 -c $< .endif const.h: error.h error.h: error.c @rm -f $@ @echo '/* Do not edit this file, make creates it. */' > $@ @echo '#ifndef _h_sh_err' >> $@ @echo '#define _h_sh_err' >> $@ egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@ @echo '#endif /* _h_sh_err */' >> $@ const.h: const.c @rm -f $@ @echo '/* Do not edit this file, make creates it. */' > $@ ${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \ sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \ sort >> $@ .depend alloc.o: const.h error.h .include