1996-10-06 02:35:38 +00:00
|
|
|
# @(#)Makefile 5.2 (Berkeley) 12/28/90
|
2002-04-13 10:57:56 +00:00
|
|
|
# $Id: Makefile,v 1.6 1994/06/30 05:33:39 cgd Exp $
|
1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1994-05-27 12:33:43 +00:00
|
|
|
|
|
|
|
PROG= make
|
2005-03-15 15:10:51 +00:00
|
|
|
CFLAGS+=-I${.CURDIR}
|
2005-05-10 13:45:29 +00:00
|
|
|
SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \
|
2005-05-24 15:41:34 +00:00
|
|
|
lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \
|
|
|
|
util.c var.c
|
1994-05-27 12:33:43 +00:00
|
|
|
|
2005-02-09 13:22:02 +00:00
|
|
|
NO_WERROR=
|
2005-05-24 15:46:50 +00:00
|
|
|
WARNS?= 6
|
2004-12-21 09:59:45 +00:00
|
|
|
NO_SHARED?= YES
|
2001-05-18 09:05:56 +00:00
|
|
|
|
2004-08-12 11:49:55 +00:00
|
|
|
CFLAGS+=-DMAKE_VERSION=\"5200408120\"
|
2004-09-06 15:25:07 +00:00
|
|
|
# There is no obvious performance improvement currently.
|
2002-10-04 20:30:03 +00:00
|
|
|
# CFLAGS+=-DUSE_KQUEUE
|
|
|
|
|
2005-05-25 08:46:31 +00:00
|
|
|
# Make object files which depend on preprocessor symbols defined in
|
|
|
|
# the Makefile which are not compilation options but rather configuration
|
|
|
|
# options dependend on the Makefile. main.c needs MAKE_VERSION while
|
|
|
|
# shell.c uses DEFSHELLNAME. This will cause recompilation in the case
|
|
|
|
# the definition is changed in the makefile. It will of course not cause
|
|
|
|
# recompilation if one does 'make MAKE_SHELL=csh'.
|
2005-05-24 15:48:10 +00:00
|
|
|
main.o shell.o: ${MAKEFILE}
|
2002-05-22 14:35:47 +00:00
|
|
|
|
2005-04-28 12:05:43 +00:00
|
|
|
# Directive and keyword tables. We use hash tables. These hash tables have been
|
2005-09-26 20:34:21 +00:00
|
|
|
# generated with mph (ports/devel/mph)
|
2005-04-28 12:05:43 +00:00
|
|
|
# If you change the directives or keywords (adding, deleting, reordering) you
|
|
|
|
# need to create new tables and hash functions (directive_hash, keyword_hash).
|
2005-04-28 07:55:55 +00:00
|
|
|
#
|
|
|
|
# The following changes have been made to the generated code:
|
|
|
|
#
|
2005-04-28 12:05:43 +00:00
|
|
|
# o prefix the names of the g, T0 and T1 arrays with 'directive_'
|
|
|
|
# resp. 'keyword_'.
|
2005-04-28 07:55:55 +00:00
|
|
|
#
|
|
|
|
# o make the type of the tables 'const [un]signed char' (if you change
|
|
|
|
# anything make sure that the numbers fit into a char).
|
|
|
|
#
|
|
|
|
# o make the hash function use the length for termination,
|
2005-04-28 12:05:43 +00:00
|
|
|
# not the trailing '\0', via the -l flag in emitc and some editing
|
|
|
|
# (only for directive_hash).
|
2005-04-28 07:55:55 +00:00
|
|
|
|
|
|
|
LOCALBASE ?= /usr/local
|
|
|
|
MPH ?= ${LOCALBASE}/bin/mph
|
|
|
|
EMITC ?= ${LOCALBASE}/bin/emitc
|
|
|
|
|
|
|
|
.PRECIOUS: hash
|
2005-04-28 12:05:43 +00:00
|
|
|
|
2005-04-28 07:55:55 +00:00
|
|
|
hash:
|
|
|
|
( echo '/*' ; \
|
|
|
|
echo ' * DO NOT EDIT' ; \
|
2005-04-28 08:04:46 +00:00
|
|
|
echo ' * $$''FreeBSD$$' ; \
|
2005-04-28 07:55:55 +00:00
|
|
|
echo -n ' * auto-generated from ' ; \
|
|
|
|
sed -nEe '/\$$FreeBSD/s/^.*\$$(.*)\$$.*$$/\1/p' \
|
|
|
|
${.CURDIR}/parse.c ; \
|
|
|
|
echo ' * DO NOT EDIT' ; \
|
|
|
|
echo ' */' ; \
|
|
|
|
echo '#include <sys/types.h>' ; \
|
|
|
|
echo ; \
|
2005-04-29 15:15:28 +00:00
|
|
|
echo '#include "hash_tables.h"' ; \
|
2005-04-28 07:55:55 +00:00
|
|
|
echo ; \
|
|
|
|
cat ${.CURDIR}/parse.c | sed \
|
|
|
|
-e '1,/DIRECTIVES-START-TAG/d' \
|
|
|
|
-e '/DIRECTIVES-END-TAG/,$$d' \
|
|
|
|
-e 's/^[^"]*"\([^"]*\)".*$$/\1/' | \
|
|
|
|
${MPH} -d2 -m1 | ${EMITC} -l -s | \
|
|
|
|
sed \
|
|
|
|
-e 's/^static int g\[\]/static const signed char directive_g[]/' \
|
|
|
|
-e 's/^static int T0\[\]/static const u_char directive_T0[]/' \
|
|
|
|
-e 's/^static int T1\[\]/static const u_char directive_T1[]/' \
|
|
|
|
-e '/^#define uchar unsigned char/d' \
|
|
|
|
-e 's/uchar/u_char/g' \
|
|
|
|
-e 's/^hash(/directive_hash(/' \
|
|
|
|
-e 's/; \*kp;/; kp < key + len;/' \
|
|
|
|
-e 's/int len)/size_t len)/' \
|
|
|
|
-e 's/= T0\[/= directive_T0\[/' \
|
|
|
|
-e 's/= T1\[/= directive_T1\[/' \
|
2005-04-28 12:05:43 +00:00
|
|
|
-e 's/g\[f/directive_g[f/g' ; \
|
|
|
|
cat ${.CURDIR}/parse.c | sed \
|
|
|
|
-e '1,/KEYWORD-START-TAG/d' \
|
|
|
|
-e '/KEYWORD-END-TAG/,$$d' \
|
|
|
|
-e 's/^[^"]*"\([^"]*\)".*$$/\1/' | \
|
|
|
|
${MPH} -d2 -m1 | ${EMITC} -l -s | \
|
|
|
|
sed \
|
|
|
|
-e 's/^static int g\[\]/static const signed char keyword_g[]/' \
|
|
|
|
-e 's/^static int T0\[\]/static const u_char keyword_T0[]/' \
|
|
|
|
-e 's/^static int T1\[\]/static const u_char keyword_T1[]/' \
|
|
|
|
-e '/^#define uchar unsigned char/d' \
|
|
|
|
-e 's/uchar/u_char/g' \
|
|
|
|
-e 's/^hash(/keyword_hash(/' \
|
|
|
|
-e 's/int len)/size_t len)/' \
|
|
|
|
-e 's/= T0\[/= keyword_T0\[/' \
|
|
|
|
-e 's/= T1\[/= keyword_T1\[/' \
|
|
|
|
-e 's/g\[f/keyword_g[f/g' \
|
2005-04-29 15:15:28 +00:00
|
|
|
) > ${.CURDIR}/hash_tables.c
|
2005-04-28 07:55:55 +00:00
|
|
|
|
2000-08-16 23:31:43 +00:00
|
|
|
# Set the shell which make(1) uses. Bourne is the default, but a decent
|
|
|
|
# Korn shell works fine, and much faster. Using the C shell for this
|
|
|
|
# will almost certainly break everything, but it's Unix tradition to
|
|
|
|
# allow you to shoot yourself in the foot if you want to :-)
|
|
|
|
|
|
|
|
MAKE_SHELL?= sh
|
2005-05-24 13:19:40 +00:00
|
|
|
.if ${MAKE_SHELL} == "csh" || ${MAKE_SHELL} == "sh" || ${MAKE_SHELL} == "ksh"
|
|
|
|
CFLAGS+= -DDEFSHELLNAME=\"${MAKE_SHELL}\"
|
2000-08-16 23:31:43 +00:00
|
|
|
.else
|
|
|
|
.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
|
|
|
|
.endif
|
|
|
|
|
1994-05-27 12:33:43 +00:00
|
|
|
.include <bsd.prog.mk>
|