• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# /****************************************************************
2# Copyright (C) Lucent Technologies 1997
3# All Rights Reserved
4#
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
13# permission.
14#
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
22# THIS SOFTWARE.
23# ****************************************************************/
24
25CFLAGS = -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls
26CFLAGS = -g
27CFLAGS =
28CFLAGS = -O2
29
30# compiler options
31#CC = gcc -Wall -g -Wwrite-strings
32#CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing
33#CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
34HOSTCC = gcc -g -Wall -pedantic -Wcast-qual
35CC = $(HOSTCC)  # change this is cross-compiling.
36
37# By fiat, to make our lives easier, yacc is now defined to be bison.
38# If you want something else, you're on your own.
39# YACC = yacc -d -b awkgram
40YACC = bison -d
41
42OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
43
44SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \
45	maketab.c parse.c lib.c run.c tran.c proctab.c
46
47LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
48	lib.c run.c tran.c
49
50SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile  \
51	 awk.1
52
53a.out:	awkgram.tab.o $(OFILES)
54	$(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC)  -lm
55
56$(OFILES):	awk.h awkgram.tab.h proto.h
57
58awkgram.tab.c awkgram.tab.h:	awk.h proto.h awkgram.y
59	$(YACC) $(YFLAGS) awkgram.y
60
61proctab.c:	maketab
62	./maketab awkgram.tab.h >proctab.c
63
64maketab:	awkgram.tab.h maketab.c
65	$(HOSTCC) $(CFLAGS) maketab.c -o maketab
66
67bundle:
68	@cp awkgram.tab.h awkgram.tab.h.bak
69	@cp awkgram.tab.c awkgram.tab.c.bak
70	@bundle $(SHIP)
71
72tar:
73	@cp awkgram.tab.h awkgram.tab.h.bak
74	@cp awkgram.tab.c awkgram.tab.c.bak
75	@bundle $(SHIP) >awk.shar
76	@tar cf awk.tar $(SHIP)
77	gzip awk.tar
78	ls -l awk.tar.gz
79	@zip awk.zip $(SHIP)
80	ls -l awk.zip
81
82gitadd:
83	git add README LICENSE FIXES \
84           awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
85	   lib.c run.c tran.c \
86	   makefile awk.1 testdir
87
88gitpush:
89	# only do this once:
90	# git remote add origin https://github.com/onetrueawk/awk.git
91	git push -u origin master
92
93names:
94	@echo $(LISTING)
95
96test check:
97	./REGRESS
98
99clean: testclean
100	rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
101
102cleaner: testclean
103	rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.*
104
105# This is a bit of a band-aid until we can invest some more time
106# in the test suite.
107testclean:
108	cd testdir; rm -fr arnold-fixes beebe devnull echo foo* \
109		glop glop1 glop2 lilly.diff tempbig tempsmall time
110
111# For the habits of GNU maintainers:
112distclean: cleaner
113