2012-12-22 10:35:39 -05:00
|
|
|
# /****************************************************************
|
|
|
|
# Copyright (C) Lucent Technologies 1997
|
|
|
|
# All Rights Reserved
|
2019-07-28 07:51:52 -04:00
|
|
|
#
|
2012-12-22 10:35:39 -05: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.
|
2019-07-28 07:51:52 -04:00
|
|
|
#
|
2012-12-22 10:35:39 -05: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.
|
|
|
|
# ****************************************************************/
|
|
|
|
|
2020-02-28 06:18:29 -05:00
|
|
|
CFLAGS = -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
2012-12-22 10:35:39 -05:00
|
|
|
CFLAGS = -g
|
|
|
|
CFLAGS =
|
2018-08-24 09:09:59 -04:00
|
|
|
CFLAGS = -O2
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2018-08-24 09:09:59 -04:00
|
|
|
# compiler options
|
2018-08-22 13:40:26 -04:00
|
|
|
#CC = gcc -Wall -g -Wwrite-strings
|
|
|
|
#CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing
|
|
|
|
#CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
|
2019-10-24 09:42:51 -04:00
|
|
|
HOSTCC = gcc -g -Wall -pedantic -Wcast-qual
|
2019-03-12 15:54:57 -04:00
|
|
|
CC = $(HOSTCC) # change this is cross-compiling.
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2020-07-30 10:12:45 -04: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.
|
2020-02-18 14:20:27 -05:00
|
|
|
YACC = bison -d
|
2012-12-22 10:35:39 -05:00
|
|
|
|
|
|
|
OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
|
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \
|
2019-07-28 07:51:52 -04:00
|
|
|
maketab.c parse.c lib.c run.c tran.c proctab.c
|
2012-12-22 10:35:39 -05:00
|
|
|
|
|
|
|
LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
|
2019-07-28 07:51:52 -04:00
|
|
|
lib.c run.c tran.c
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile \
|
2012-12-22 10:35:39 -05:00
|
|
|
awk.1
|
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
a.out: awkgram.tab.o $(OFILES)
|
|
|
|
$(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC) -lm
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
$(OFILES): awk.h awkgram.tab.h proto.h
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
awkgram.tab.c awkgram.tab.h: awk.h proto.h awkgram.y
|
2012-12-22 10:35:39 -05:00
|
|
|
$(YACC) $(YFLAGS) awkgram.y
|
|
|
|
|
|
|
|
proctab.c: maketab
|
2020-07-30 10:12:45 -04:00
|
|
|
./maketab awkgram.tab.h >proctab.c
|
2012-12-22 10:35:39 -05:00
|
|
|
|
2020-07-30 10:12:45 -04:00
|
|
|
maketab: awkgram.tab.h maketab.c
|
2019-03-12 15:52:17 -04:00
|
|
|
$(HOSTCC) $(CFLAGS) maketab.c -o maketab
|
2012-12-22 10:35:39 -05:00
|
|
|
|
|
|
|
bundle:
|
2020-07-30 10:12:45 -04:00
|
|
|
@cp awkgram.tab.h awkgram.tab.h.bak
|
|
|
|
@cp awkgram.tab.c awkgram.tab.c.bak
|
2012-12-22 10:35:39 -05:00
|
|
|
@bundle $(SHIP)
|
|
|
|
|
|
|
|
tar:
|
2020-07-30 10:12:45 -04:00
|
|
|
@cp awkgram.tab.h awkgram.tab.h.bak
|
|
|
|
@cp awkgram.tab.c awkgram.tab.c.bak
|
2012-12-22 10:35:39 -05: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
|
|
|
|
|
|
|
|
gitadd:
|
2018-08-15 10:45:03 -04:00
|
|
|
git add README LICENSE FIXES \
|
2012-12-22 10:35:39 -05:00
|
|
|
awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
|
|
|
|
lib.c run.c tran.c \
|
2019-06-24 03:10:24 -04:00
|
|
|
makefile awk.1 testdir
|
2012-12-22 10:35:39 -05:00
|
|
|
|
|
|
|
gitpush:
|
2019-07-28 07:51:52 -04:00
|
|
|
# only do this once:
|
2018-08-15 10:45:03 -04:00
|
|
|
# git remote add origin https://github.com/onetrueawk/awk.git
|
2012-12-22 10:35:39 -05:00
|
|
|
git push -u origin master
|
|
|
|
|
|
|
|
names:
|
|
|
|
@echo $(LISTING)
|
|
|
|
|
2019-06-24 03:10:24 -04:00
|
|
|
test check:
|
|
|
|
./REGRESS
|
|
|
|
|
|
|
|
clean: testclean
|
2012-12-22 10:35:39 -05:00
|
|
|
rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
|
2018-08-15 10:45:03 -04:00
|
|
|
|
2019-06-24 03:10:24 -04:00
|
|
|
cleaner: testclean
|
2020-07-30 10:12:45 -04:00
|
|
|
rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.*
|
2019-06-24 03:10:24 -04:00
|
|
|
|
|
|
|
# This is a bit of a band-aid until we can invest some more time
|
|
|
|
# in the test suite.
|
|
|
|
testclean:
|
2020-10-13 13:52:43 -04:00
|
|
|
cd testdir; rm -fr arnold-fixes beebe devnull echo foo* \
|
2019-07-26 05:57:48 -04:00
|
|
|
glop glop1 glop2 lilly.diff tempbig tempsmall time
|
2019-10-24 09:44:00 -04:00
|
|
|
|
|
|
|
# For the habits of GNU maintainers:
|
2020-07-30 10:12:45 -04:00
|
|
|
distclean: cleaner
|