Deleted Added
full compact
Makefile (145614) Makefile (145616)
1# @(#)Makefile 5.2 (Berkeley) 12/28/90
2# $Id: Makefile,v 1.6 1994/06/30 05:33:39 cgd Exp $
1# @(#)Makefile 5.2 (Berkeley) 12/28/90
2# $Id: Makefile,v 1.6 1994/06/30 05:33:39 cgd Exp $
3# $FreeBSD: head/usr.bin/make/Makefile 145614 2005-04-28 08:04:46Z harti $
3# $FreeBSD: head/usr.bin/make/Makefile 145616 2005-04-28 12:05:43Z harti $
4
5PROG= make
6CFLAGS+=-I${.CURDIR}
7SRCS= arch.c buf.c compat.c cond.c dir.c directive_hash.c for.c \
8 hash.c job.c lst.c main.c make.c parse.c str.c suff.c targ.c \
9 util.c var.c var_modify.c
10
11NO_WERROR=

--- 5 unchanged lines hidden (view full) ---

17CFLAGS+=-D__FBSDID=__RCSID
18.endif
19
20# There is no obvious performance improvement currently.
21# CFLAGS+=-DUSE_KQUEUE
22
23main.o: ${MAKEFILE}
24
4
5PROG= make
6CFLAGS+=-I${.CURDIR}
7SRCS= arch.c buf.c compat.c cond.c dir.c directive_hash.c for.c \
8 hash.c job.c lst.c main.c make.c parse.c str.c suff.c targ.c \
9 util.c var.c var_modify.c
10
11NO_WERROR=

--- 5 unchanged lines hidden (view full) ---

17CFLAGS+=-D__FBSDID=__RCSID
18.endif
19
20# There is no obvious performance improvement currently.
21# CFLAGS+=-DUSE_KQUEUE
22
23main.o: ${MAKEFILE}
24
25# Directive table. We use a hash table. This hash table has been
25# Directive and keyword tables. We use hash tables. These hash tables have been
26# generated with mph which can be found on the usual GNU mirrors.
26# generated with mph which can be found on the usual GNU mirrors.
27# If you change the directives (adding, deleting, reordering) you
28# need to create a new table and hash function (directive_hash).
27# If you change the directives or keywords (adding, deleting, reordering) you
28# need to create new tables and hash functions (directive_hash, keyword_hash).
29#
30# The following changes have been made to the generated code:
31#
29#
30# The following changes have been made to the generated code:
31#
32# o prefix the names of the g, T0 and T1 arrays with 'directive_'.
32# o prefix the names of the g, T0 and T1 arrays with 'directive_'
33# resp. 'keyword_'.
33#
34# o make the type of the tables 'const [un]signed char' (if you change
35# anything make sure that the numbers fit into a char).
36#
37# o make the hash function use the length for termination,
34#
35# o make the type of the tables 'const [un]signed char' (if you change
36# anything make sure that the numbers fit into a char).
37#
38# o make the hash function use the length for termination,
38# not the trailing '\0', via the -l flag in emitc and some editing.
39# not the trailing '\0', via the -l flag in emitc and some editing
40# (only for directive_hash).
39
40LOCALBASE ?= /usr/local
41MPH ?= ${LOCALBASE}/bin/mph
42EMITC ?= ${LOCALBASE}/bin/emitc
43
44.PRECIOUS: hash
41
42LOCALBASE ?= /usr/local
43MPH ?= ${LOCALBASE}/bin/mph
44EMITC ?= ${LOCALBASE}/bin/emitc
45
46.PRECIOUS: hash
47
45hash:
46 ( echo '/*' ; \
47 echo ' * DO NOT EDIT' ; \
48 echo ' * $$''FreeBSD$$' ; \
49 echo -n ' * auto-generated from ' ; \
50 sed -nEe '/\$$FreeBSD/s/^.*\$$(.*)\$$.*$$/\1/p' \
51 ${.CURDIR}/parse.c ; \
52 echo ' * DO NOT EDIT' ; \

--- 13 unchanged lines hidden (view full) ---

66 -e 's/^static int T1\[\]/static const u_char directive_T1[]/' \
67 -e '/^#define uchar unsigned char/d' \
68 -e 's/uchar/u_char/g' \
69 -e 's/^hash(/directive_hash(/' \
70 -e 's/; \*kp;/; kp < key + len;/' \
71 -e 's/int len)/size_t len)/' \
72 -e 's/= T0\[/= directive_T0\[/' \
73 -e 's/= T1\[/= directive_T1\[/' \
48hash:
49 ( echo '/*' ; \
50 echo ' * DO NOT EDIT' ; \
51 echo ' * $$''FreeBSD$$' ; \
52 echo -n ' * auto-generated from ' ; \
53 sed -nEe '/\$$FreeBSD/s/^.*\$$(.*)\$$.*$$/\1/p' \
54 ${.CURDIR}/parse.c ; \
55 echo ' * DO NOT EDIT' ; \

--- 13 unchanged lines hidden (view full) ---

69 -e 's/^static int T1\[\]/static const u_char directive_T1[]/' \
70 -e '/^#define uchar unsigned char/d' \
71 -e 's/uchar/u_char/g' \
72 -e 's/^hash(/directive_hash(/' \
73 -e 's/; \*kp;/; kp < key + len;/' \
74 -e 's/int len)/size_t len)/' \
75 -e 's/= T0\[/= directive_T0\[/' \
76 -e 's/= T1\[/= directive_T1\[/' \
74 -e 's/g\[f/directive_g[f/g' \
77 -e 's/g\[f/directive_g[f/g' ; \
78 cat ${.CURDIR}/parse.c | sed \
79 -e '1,/KEYWORD-START-TAG/d' \
80 -e '/KEYWORD-END-TAG/,$$d' \
81 -e 's/^[^"]*"\([^"]*\)".*$$/\1/' | \
82 ${MPH} -d2 -m1 | ${EMITC} -l -s | \
83 sed \
84 -e 's/^static int g\[\]/static const signed char keyword_g[]/' \
85 -e 's/^static int T0\[\]/static const u_char keyword_T0[]/' \
86 -e 's/^static int T1\[\]/static const u_char keyword_T1[]/' \
87 -e '/^#define uchar unsigned char/d' \
88 -e 's/uchar/u_char/g' \
89 -e 's/^hash(/keyword_hash(/' \
90 -e 's/int len)/size_t len)/' \
91 -e 's/= T0\[/= keyword_T0\[/' \
92 -e 's/= T1\[/= keyword_T1\[/' \
93 -e 's/g\[f/keyword_g[f/g' \
75 ) > ${.CURDIR}/directive_hash.c
76
77# Set the shell which make(1) uses. Bourne is the default, but a decent
78# Korn shell works fine, and much faster. Using the C shell for this
79# will almost certainly break everything, but it's Unix tradition to
80# allow you to shoot yourself in the foot if you want to :-)
81
82MAKE_SHELL?= sh
83.if ${MAKE_SHELL} == "csh"
84CFLAGS+= -DDEFSHELL=0
85.elif ${MAKE_SHELL} == "sh"
86CFLAGS+= -DDEFSHELL=1
87.elif ${MAKE_SHELL} == "ksh"
88CFLAGS+= -DDEFSHELL=2
89.else
90.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
91.endif
92
93.include <bsd.prog.mk>
94 ) > ${.CURDIR}/directive_hash.c
95
96# Set the shell which make(1) uses. Bourne is the default, but a decent
97# Korn shell works fine, and much faster. Using the C shell for this
98# will almost certainly break everything, but it's Unix tradition to
99# allow you to shoot yourself in the foot if you want to :-)
100
101MAKE_SHELL?= sh
102.if ${MAKE_SHELL} == "csh"
103CFLAGS+= -DDEFSHELL=0
104.elif ${MAKE_SHELL} == "sh"
105CFLAGS+= -DDEFSHELL=1
106.elif ${MAKE_SHELL} == "ksh"
107CFLAGS+= -DDEFSHELL=2
108.else
109.error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
110.endif
111
112.include <bsd.prog.mk>