2626# to get definitions of all signals from <sys/signal.h>.
2727# _POSIX_SOURCE, _XOPEN_SOURCE are the obvious ones.
2828
29- datarootdir = @datarootdir@
3029prefix = @prefix@
30+ datarootdir = @datarootdir@
31+ datadir = @datadir@
3132exec_prefix = @exec_prefix@
3233mandir = @mandir@
3334bindir = @bindir@
3435srcdir = @srcdir@
36+ testdir = @srcdir@/test
37+
38+ VPATH = $(srcdir )
3539
3640
3741SHELL = /bin/sh
3842CC = @CC@
43+ YACC = @YACC@
3944INSTALL = @INSTALL@
45+ INSTALL_PROGRAM = $(INSTALL )
46+ INSTALL_DATA = $(INSTALL ) -m 644
4047MKDIR_P = @MKDIR_P@
4148
4249
43- # # Bison is generating incorrect parsers. So do not use, for now
44- # YACC = @YACC@
45-
46- CFLAGS = $(ADDCFLAGS ) -I. -I$(srcdir ) -W -Wall -Wno-implicit-fallthrough -Wno-cast-function-type -Wno-missing-field-initializers -Wno-unused-parameter -Wno-clobbered @CFLAGS@
47- LDFLAGS = $(ADDLDFLAGS ) @LDFLAGS@
48- LIBS = $(ADDLIBS ) @LIBS@
49-
50- VPATH = $(srcdir )
50+ CFLAGS = @STRICT_CFLAGS@ -I. -I$(srcdir ) -W -Wall @READLINE_CFLAGS@ @CFLAGS@ $(ADDCFLAGS )
51+ LDFLAGS = @LDFLAGS@ $(ADDLDFLAGS )
52+ LIBS = @READLINE_LIBS@ @LIBS@ $(ADDLIBS )
5153
5254HFILES = config.h es.h gc.h input.h prim.h print.h sigmsgs.h \
5355 stdenv.h syntax.h term.h var.h
5456CFILES = access.c closure.c conv.c dict.c eval.c except.c fd.c gc.c glob.c \
55- glom.c input.c heredoc.c list.c main.c match.c open.c \
57+ glom.c input.c heredoc.c history.c list.c main.c match.c open.c \
5658 prim-ctl.c prim-etc.c prim-io.c prim-sys.c prim-dump.c prim.c print.c proc.c \
5759 sigmsgs.c signal.c split.c status.c str.c syntax.c term.c token.c \
5860 tree.c util.c var.c vec.c version.c y.tab.c dump.c
5961OFILES = access.o closure.o conv.o dict.o eval.o except.o fd.o gc.o glob.o \
60- glom.o input.o heredoc.o list.o main.o match.o open.o \
62+ glom.o input.o heredoc.o history.o list.o main.o match.o open.o \
6163 prim-ctl.o prim-etc.o prim-io.o prim-sys.o prim-dump.o prim.o print.o proc.o \
6264 sigmsgs.o signal.o split.o status.o str.o syntax.o term.o token.o \
6365 tree.o util.o var.o vec.o version.o y.tab.o
@@ -66,38 +68,46 @@ GEN = esdump y.tab.c y.tab.h y.output token.h sigmsgs.c initial.c
6668
6769SIGFILES = @SIGFILES@
6870
69- es : ${ OFILES} initial.o
70- ${CC} -o es ${ LDFLAGS} ${ OFILES} initial.o ${ LIBS}
71+ es : $( OFILES ) initial.o
72+ $( CC ) -o es $( LDFLAGS ) $( OFILES ) initial.o $( LIBS )
7173
72- esdump : ${ OFILES} dump.o
73- ${CC} -o esdump ${ LDFLAGS} ${ OFILES} dump.o ${ LIBS}
74+ esdump : $( OFILES ) dump.o
75+ $( CC ) -o esdump $( LDFLAGS ) $( OFILES ) dump.o $( LIBS )
7476
7577clean :
76- rm -f es ${ OFILES} ${ GEN} dump.o initial.o
78+ rm -f es $( OFILES ) $( GEN ) dump.o initial.o
7779
78- distclean : clean
80+ distclean : clean testclean
7981 rm -f config.cache config.log config.h Makefile cscope.out tags TAGS core cs.out config.status ltmain.sh
80- rm -rf autom4te.cache
82+ rm -rf autom4te.cache
8183
8284MANIFEST :
8385 find . -type f | sed s/..// > MANIFEST
8486
8587install : es
8688 $(MKDIR_P ) $(DESTDIR )$(bindir )
87- $(INSTALL ) -s $( srcdir ) / es $(DESTDIR )$(bindir )
89+ $(INSTALL_PROGRAM ) -s es $(DESTDIR )$(bindir )
8890 $(MKDIR_P ) $(DESTDIR )$(mandir ) /man1
89- $(INSTALL ) $(srcdir ) /doc/es.1 $(DESTDIR )$(mandir ) /man1
91+ $(INSTALL_DATA ) $(srcdir ) /doc/es.1 $(DESTDIR )$(mandir ) /man1
92+ $(MKDIR_P ) $(DESTDIR )$(datadir ) /es
93+ $(INSTALL_DATA ) $(srcdir ) /share/* $(DESTDIR )$(datadir ) /es
9094
91- test : trip
95+ testrun : $(testdir ) /testrun.c
96+ $(CC ) -o testrun $(testdir ) /testrun.c
9297
93- trip : es $(srcdir ) /trip.es
94- ./es < $(srcdir ) /trip.es
98+ test : es testrun $(testdir ) /test.es
99+ ./es -ps < $(testdir ) /test.es $(testdir ) /tests/*
100+
101+ testclean :
102+ rm -f testrun
95103
96104src :
97- @echo ${OTHER} ${CFILES} ${HFILES}
105+ @echo $(OTHER ) $(CFILES ) $(HFILES )
106+
107+ y.tab.h : parse.y
108+ $(YACC ) -vd $(srcdir ) /parse.y
98109
99- y.tab.c y.tab.h : parse.y
100- ${YACC} -vd $(srcdir ) /parse.y
110+ y.tab.c : y.tab.h
101111
102112token.h : y.tab.h
103113 -cmp -s y.tab.h token.h || cp y.tab.h token.h
@@ -114,39 +124,39 @@ config.h : config.h.in
114124
115125# --- dependencies ---
116126
117- access.o : access.c es.h config.h stdenv.h prim.h
118- closure.o : closure.c es.h config.h stdenv.h gc.h
119- conv.o : conv.c es.h config.h stdenv.h print.h
120- dict.o : dict.c es.h config.h stdenv.h gc.h
121- eval.o : eval.c es.h config.h stdenv.h
122- except.o : except.c es.h config.h stdenv.h print.h
123- fd.o : fd.c es.h config.h stdenv.h
124- gc.o : gc.c es.h config.h stdenv.h gc.h
125- glob.o : glob.c es.h config.h stdenv.h gc.h
126- glom.o : glom.c es.h config.h stdenv.h gc.h
127- input.o : input.c es.h config.h stdenv.h input.h
128- heredoc.o : heredoc.c es.h config.h stdenv.h gc.h input.h syntax.h
129- list .o : list .c es.h config.h stdenv.h gc.h
130- main .o : main .c es.h config.h stdenv.h
131- match .o : match .c es.h config.h stdenv.h
132- open .o : open .c es.h config.h stdenv.h
133- prim .o : prim .c es.h config.h stdenv.h prim.h
134- prim-ctl .o : prim-ctl .c es.h config.h stdenv.h prim.h
135- prim-etc .o : prim-etc .c es.h config.h stdenv.h prim.h
136- prim-io .o : prim-io .c es.h config.h stdenv.h gc.h prim.h
137- prim-sys .o : prim-sys .c es.h config.h stdenv.h prim .h
138- prim-dump .o : prim-dump .c es.h config.h stdenv.h prim.h
139- print.o : print.c es.h config.h stdenv.h print.h
140- proc.o : proc.c es.h config.h stdenv.h prim.h
141- signal.o : signal.c es.h config.h stdenv.h sigmsgs.h
142- split.o : split.c es.h config.h stdenv.h gc.h
143- status.o : status.c es.h config.h stdenv.h term.h
144- str.o : str.c es.h config.h stdenv.h gc.h print.h
145- syntax.o : syntax.c es.h config.h stdenv.h input.h syntax.h token.h
146- term.o : term.c es.h config.h stdenv.h gc.h term.h
147- token.o : token.c es.h config.h stdenv.h input.h syntax.h token.h
148- tree.o : tree.c es.h config.h stdenv.h gc.h
149- util.o : util.c es.h config.h stdenv.h
150- var.o : var.c es.h config.h stdenv.h gc.h var.h term.h
151- vec.o : vec.c es.h config.h stdenv.h gc.h
152- version.o : version.c es.h config.h stdenv.h
127+ access.o : access.c es.h config.h stdenv.h prim.h
128+ closure.o : closure.c es.h config.h stdenv.h gc.h
129+ conv.o : conv.c es.h config.h stdenv.h print.h
130+ dict.o : dict.c es.h config.h stdenv.h gc.h
131+ eval.o : eval.c es.h config.h stdenv.h
132+ except.o : except.c es.h config.h stdenv.h print.h
133+ fd.o : fd.c es.h config.h stdenv.h
134+ gc.o : gc.c es.h config.h stdenv.h gc.h
135+ glob.o : glob.c es.h config.h stdenv.h gc.h
136+ glom.o : glom.c es.h config.h stdenv.h gc.h
137+ input.o : input.c es.h config.h stdenv.h input.h
138+ heredoc.o : heredoc.c es.h config.h stdenv.h gc.h input.h syntax.h
139+ history .o : history .c es.h config.h stdenv.h gc.h input.h
140+ list .o : list .c es.h config.h stdenv.h gc.h
141+ main .o : main .c es.h config.h stdenv.h
142+ match .o : match .c es.h config.h stdenv.h
143+ open .o : open .c es.h config.h stdenv.h
144+ prim.o : prim.c es.h config.h stdenv.h prim.h
145+ prim-ctl .o : prim-ctl .c es.h config.h stdenv.h prim.h
146+ prim-etc .o : prim-etc .c es.h config.h stdenv.h prim.h
147+ prim-io .o : prim-io .c es.h config.h stdenv.h gc .h prim.h
148+ prim-sys .o : prim-sys .c es.h config.h stdenv.h prim.h
149+ print.o : print.c es.h config.h stdenv.h print.h
150+ proc.o : proc.c es.h config.h stdenv.h prim.h
151+ signal.o : signal.c es.h config.h stdenv.h sigmsgs.h
152+ split.o : split.c es.h config.h stdenv.h gc.h
153+ status.o : status.c es.h config.h stdenv.h term.h
154+ str.o : str.c es.h config.h stdenv.h gc.h print.h
155+ syntax.o : syntax.c es.h config.h stdenv.h input.h syntax.h token.h
156+ term.o : term.c es.h config.h stdenv.h gc.h term.h
157+ token.o : token.c es.h config.h stdenv.h input.h syntax.h token.h
158+ tree.o : tree.c es.h config.h stdenv.h gc.h
159+ util.o : util.c es.h config.h stdenv.h
160+ var.o : var.c es.h config.h stdenv.h gc.h var.h term.h
161+ vec.o : vec.c es.h config.h stdenv.h gc.h
162+ version.o : version.c es.h config.h stdenv.h
0 commit comments