2002-03-16 16:50:57 +00:00
|
|
|
# /****************************************************************
|
|
|
|
# Copyright (C) Lucent Technologies 1997
|
|
|
|
# All Rights Reserved
|
2021-07-07 23:03:17 +00:00
|
|
|
#
|
2002-03-16 16:50:57 +00:00
|
|
|
# Permission to use, copy, modify, and distribute this software and
|
|
|
|
# its documentation for any purpose and without fee is hereby
|
|
|
|
# granted, provided that the above copyright notice appear in all
|
|
|
|
# copies and that both that the copyright notice and this
|
|
|
|
# permission notice and warranty disclaimer appear in supporting
|
|
|
|
# documentation, and that the name Lucent Technologies or any of
|
|
|
|
# its entities not be used in advertising or publicity pertaining
|
|
|
|
# to distribution of the software without specific, written prior
|
|
|
|
# permission.
|
2021-07-07 23:03:17 +00:00
|
|
|
#
|
2002-03-16 16:50:57 +00:00
|
|
|
# LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
|
|
|
# IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
|
|
|
|
# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
|
|
|
|
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
|
|
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
|
|
# THIS SOFTWARE.
|
|
|
|
# ****************************************************************/
|
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
CFLAGS = -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
2002-03-16 16:50:57 +00:00
|
|
|
CFLAGS = -g
|
|
|
|
CFLAGS =
|
2019-06-02 04:23:56 +00:00
|
|
|
CFLAGS = -O2
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2019-06-02 04:23:56 +00:00
|
|
|
# compiler options
|
ota: Import ota from 20241124 (930d75157063)
Minor bug fixes to man page, tests, fnematch (fixing erroneous output),
string escape sequences and improve flow control by optimizing gototab.
Nov 24, 2023:
Fix issue #199: gototab improvements to dynamically resize the
table, qsort and bsearch to improve the lookup speed as the
table gets larger for multibyte input. thanks to Arnold Robbins.
Nov 23, 2023:
Fix Issue #169, related to escape sequences in strings.
Thanks to Github user rajeevvp.
Fix Issue #147, reported by Github user drawkula, and fixed
by Miguel Pineiro Jr.
Nov 20, 2023:
rewrite of fnematch to fix a number of issues, including
extraneous output, out-of-bounds access, number of bytes
to push back after a failed match etc.
thanks to Miguel Pineiro Jr.
Nov 15, 2023:
Man page edit, regression test fixes. thanks to Arnold Robbins
consolidation of sub and gsub into dosub, removing duplicate
code. thanks to Miguel Pineiro Jr.
gcc replaced with cc everywhere.
Sponsored by: Netflix
2023-11-26 15:12:04 +00:00
|
|
|
#CC = cc -Wall -g -Wwrite-strings
|
|
|
|
#CC = cc -O4 -Wall -pedantic -fno-strict-aliasing
|
|
|
|
#CC = cc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
|
|
|
|
HOSTCC = cc -g -Wall -pedantic -Wcast-qual
|
2019-06-02 04:23:56 +00:00
|
|
|
CC = $(HOSTCC) # change this is cross-compiling.
|
2007-06-05 15:33:51 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
# By fiat, to make our lives easier, yacc is now defined to be bison.
|
|
|
|
# If you want something else, you're on your own.
|
|
|
|
YACC = bison -d
|
2002-03-16 16:50:57 +00:00
|
|
|
|
|
|
|
OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
|
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \
|
|
|
|
maketab.c parse.c lib.c run.c tran.c proctab.c
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2002-12-13 04:59:48 +00:00
|
|
|
LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
|
2021-07-07 23:03:17 +00:00
|
|
|
lib.c run.c tran.c
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile \
|
2011-05-03 11:37:03 +00:00
|
|
|
awk.1
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
a.out: awkgram.tab.o $(OFILES)
|
|
|
|
$(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC) -lm
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
$(OFILES): awk.h awkgram.tab.h proto.h
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
awkgram.tab.c awkgram.tab.h: awk.h proto.h awkgram.y
|
2002-03-16 16:50:57 +00:00
|
|
|
$(YACC) $(YFLAGS) awkgram.y
|
|
|
|
|
|
|
|
proctab.c: maketab
|
2021-07-07 23:03:17 +00:00
|
|
|
./maketab awkgram.tab.h >proctab.c
|
2002-03-16 16:50:57 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
maketab: awkgram.tab.h maketab.c
|
2019-06-02 04:23:56 +00:00
|
|
|
$(HOSTCC) $(CFLAGS) maketab.c -o maketab
|
2002-03-16 16:50:57 +00:00
|
|
|
|
|
|
|
bundle:
|
2021-07-07 23:03:17 +00:00
|
|
|
@cp awkgram.tab.h awkgram.tab.h.bak
|
|
|
|
@cp awkgram.tab.c awkgram.tab.c.bak
|
2002-03-16 16:50:57 +00:00
|
|
|
@bundle $(SHIP)
|
|
|
|
|
|
|
|
tar:
|
2021-07-07 23:03:17 +00:00
|
|
|
@cp awkgram.tab.h awkgram.tab.h.bak
|
|
|
|
@cp awkgram.tab.c awkgram.tab.c.bak
|
2002-03-16 16:50:57 +00:00
|
|
|
@bundle $(SHIP) >awk.shar
|
|
|
|
@tar cf awk.tar $(SHIP)
|
|
|
|
gzip awk.tar
|
|
|
|
ls -l awk.tar.gz
|
|
|
|
@zip awk.zip $(SHIP)
|
|
|
|
ls -l awk.zip
|
|
|
|
|
2019-06-02 04:23:56 +00:00
|
|
|
gitadd:
|
|
|
|
git add README LICENSE FIXES \
|
|
|
|
awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
|
|
|
|
lib.c run.c tran.c \
|
2021-07-07 23:03:17 +00:00
|
|
|
makefile awk.1 testdir
|
2019-06-02 04:23:56 +00:00
|
|
|
|
|
|
|
gitpush:
|
2021-07-07 23:03:17 +00:00
|
|
|
# only do this once:
|
2019-06-02 04:23:56 +00:00
|
|
|
# git remote add origin https://github.com/onetrueawk/awk.git
|
|
|
|
git push -u origin master
|
|
|
|
|
2002-03-16 16:50:57 +00:00
|
|
|
names:
|
|
|
|
@echo $(LISTING)
|
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
test check:
|
|
|
|
./REGRESS
|
|
|
|
|
|
|
|
clean: testclean
|
2007-06-05 15:33:51 +00:00
|
|
|
rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
|
2019-06-02 04:23:56 +00:00
|
|
|
|
2021-07-07 23:03:17 +00:00
|
|
|
cleaner: testclean
|
|
|
|
rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.*
|
|
|
|
|
|
|
|
# This is a bit of a band-aid until we can invest some more time
|
|
|
|
# in the test suite.
|
|
|
|
testclean:
|
|
|
|
cd testdir; rm -fr arnold-fixes beebe devnull echo foo* \
|
|
|
|
glop glop1 glop2 lilly.diff tempbig tempsmall time
|
|
|
|
|
|
|
|
# For the habits of GNU maintainers:
|
|
|
|
distclean: cleaner
|