3 # @(#)Makefile 5.2 (Berkeley) 12/28/90
4 # $FreeBSD: src/usr.bin/make/Makefile,v 1.13.2.1 2001/05/25 08:33:40 sobomax Exp $
5 # $DragonFly: src/usr.bin/make/Makefile,v 1.38 2008/11/03 00:25:45 pavalos Exp $
9 SRCS
= arch.c buf.c cond.c
dir.c for.c hash.c hash_tables.c job.c \
10 lst.c main.c make.c parse.c proc.c
shell.c str.c suff.c targ.c \
15 CFLAGS
+=-DMAKE_VERSION
=\"5200408120\"
17 # Make object files which depend on preprocessor symbols defined
18 # in the Makefile which are not compilation options but rather
19 # configuration options dependend on the Makefile. main.c needs
20 # MAKE_VERSION, and DEFSHELLNAME. This will cause recompilation
21 # in the case the definition is changed in the makefile. It will
22 # of course not cause recompilation if one does 'make MAKE_SHELL=csh'.
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.
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).
30 # The following changes have been made to the generated code:
32 # o prefix the names of the g, T0 and T1 arrays with 'directive_'
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).
38 # o make the hash function use the length for termination,
39 # not the trailing '\0', via the -l flag in emitc and some editing
40 # (only for directive_hash).
42 LOCALBASE ?
= /usr
/local
43 MPH ?
= ${LOCALBASE}/bin
/mph
44 EMITC ?
= ${LOCALBASE}/bin
/emitc
50 echo
' * DO NOT EDIT' ; \
51 echo
' * $$''DragonFly$$' ; \
52 echo
-n
' * auto-generated from ' ; \
53 echo
${.CURDIR
}/parse.c
; \
54 echo
' * DO NOT EDIT' ; \
56 echo
'#include <sys/types.h>' ; \
58 echo
'#include "hash_tables.h"' ; \
60 cat
${.CURDIR
}/parse.c | sed \
61 -e
'1,/DIRECTIVES-START-TAG/d' \
62 -e
'/DIRECTIVES-END-TAG/,$$d' \
63 -e
's/^[^"]*"\([^"]*\)".*$$/\1/' | \
64 ${MPH} -d2
-m1 |
${EMITC} -l
-s | \
66 -e
's/^static int g\[\]/static const signed char directive_g[]/' \
67 -e
's/^static int T0\[\]/static const u_char directive_T0[]/' \
68 -e
's/^static int T1\[\]/static const u_char directive_T1[]/' \
69 -e
'/^#define uchar unsigned char/d' \
70 -e
's/uchar/u_char/g' \
71 -e
's/^hash(/directive_hash(/' \
72 -e
's/; \*kp;/; kp < key + len;/' \
73 -e
's/int len)/size_t len)/' \
74 -e
's/= T0\[/= directive_T0\[/' \
75 -e
's/= T1\[/= directive_T1\[/' \
76 -e
's/g\[f/directive_g[f/g' ; \
77 cat
${.CURDIR
}/parse.c | sed \
78 -e
'1,/KEYWORD-START-TAG/d' \
79 -e
'/KEYWORD-END-TAG/,$$d' \
80 -e
's/^[^"]*"\([^"]*\)".*$$/\1/' | \
81 ${MPH} -d2
-m1 |
${EMITC} -l
-s | \
83 -e
's/^static int g\[\]/static const signed char keyword_g[]/' \
84 -e
's/^static int T0\[\]/static const u_char keyword_T0[]/' \
85 -e
's/^static int T1\[\]/static const u_char keyword_T1[]/' \
86 -e
'/^#define uchar unsigned char/d' \
87 -e
's/uchar/u_char/g' \
88 -e
's/^hash(/keyword_hash(/' \
89 -e
's/int len)/size_t len)/' \
90 -e
's/= T0\[/= keyword_T0\[/' \
91 -e
's/= T1\[/= keyword_T1\[/' \
92 -e
's/g\[f/keyword_g[f/g' \
93 ) > ${.CURDIR
}/hash_tables.c
95 # Set the shell which make(1) uses. Bourne is the default, but a decent
96 # Korn shell works fine, and much faster. Using the C shell for this
97 # will almost certainly break everything, but it's Unix tradition to
98 # allow you to shoot yourself in the foot if you want to :-)
101 .if
${MAKE_SHELL} == "csh" ||
${MAKE_SHELL} == "sh" ||
${MAKE_SHELL} == "ksh"
102 CFLAGS
+= -DDEFSHELLNAME
=\"${MAKE_SHELL}\"
104 .error
"MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"."
107 .
include <bsd.prog.mk
>