1 # /****************************************************************
2 # Copyright (C) Lucent Technologies 1997
5 # Permission to use, copy, modify, and distribute this software and
6 # its documentation for any purpose and without fee is hereby
7 # granted, provided that the above copyright notice appear in all
8 # copies and that both that the copyright notice and this
9 # permission notice and warranty disclaimer appear in supporting
10 # documentation, and that the name Lucent Technologies or any of
11 # its entities not be used in advertising or publicity pertaining
12 # to distribution of the software without specific, written prior
15 # LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17 # IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18 # SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20 # IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23 # ****************************************************************/
30 #CC = gcc -Wall -g -Wwrite-strings
31 #CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing
32 #CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
33 HOSTCC = gcc -g -Wall -pedantic
34 CC = $(HOSTCC) # change this is cross-compiling.
36 # yacc options. pick one; this varies a lot by system.
40 # -S uses sprintf in yacc parser instead of sprint
42 OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
44 SOURCE = awk.h ytab.c ytab.h proto.h awkgram.y lex.c b.c main.c \
45 maketab.c parse.c lib.c run.c tran.c proctab.c
47 LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
50 SHIP = README LICENSE FIXES $(SOURCE) ytab[ch].bak makefile \
53 a.out: ytab.o $(OFILES)
54 $(CC) $(CFLAGS) ytab.o $(OFILES) $(ALLOC) -lm
56 $(OFILES): awk.h ytab.h proto.h
58 #Clear dependency for parallel build: (make -j)
59 #YACC generated y.tab.c and y.tab.h at the same time
60 #this needs to be a static pattern rules otherwise multiple target
61 #are mapped onto multiple executions of yacc, which overwrite
63 y%.c y%.h: awk.h proto.h awkgram.y
64 $(YACC) $(YFLAGS) awkgram.y
71 ./maketab ytab.h >proctab.c
73 maketab: ytab.h maketab.c
74 $(HOSTCC) $(CFLAGS) maketab.c -o maketab
84 @bundle $(SHIP) >awk.shar
85 @tar cf awk.tar $(SHIP)
92 git add README LICENSE FIXES \
93 awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
95 makefile awk.1 awktest.tar
99 # git remote add origin https://github.com/onetrueawk/awk.git
100 git push -u origin master
106 rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
109 rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c ytab*