xref: /freebsd/contrib/one-true-awk/makefile (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
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 = cc -Wall -g -Wwrite-strings
32#CC = cc -O4 -Wall -pedantic -fno-strict-aliasing
33#CC = cc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov
34HOSTCC = cc -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.
39YACC = bison -d
40
41OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o
42
43SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \
44	maketab.c parse.c lib.c run.c tran.c proctab.c
45
46LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
47	lib.c run.c tran.c
48
49SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile  \
50	 awk.1
51
52a.out:	awkgram.tab.o $(OFILES)
53	$(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC)  -lm
54
55$(OFILES):	awk.h awkgram.tab.h proto.h
56
57awkgram.tab.c awkgram.tab.h:	awk.h proto.h awkgram.y
58	$(YACC) $(YFLAGS) awkgram.y
59
60proctab.c:	maketab
61	./maketab awkgram.tab.h >proctab.c
62
63maketab:	awkgram.tab.h maketab.c
64	$(HOSTCC) $(CFLAGS) maketab.c -o maketab
65
66bundle:
67	@cp awkgram.tab.h awkgram.tab.h.bak
68	@cp awkgram.tab.c awkgram.tab.c.bak
69	@bundle $(SHIP)
70
71tar:
72	@cp awkgram.tab.h awkgram.tab.h.bak
73	@cp awkgram.tab.c awkgram.tab.c.bak
74	@bundle $(SHIP) >awk.shar
75	@tar cf awk.tar $(SHIP)
76	gzip awk.tar
77	ls -l awk.tar.gz
78	@zip awk.zip $(SHIP)
79	ls -l awk.zip
80
81gitadd:
82	git add README LICENSE FIXES \
83           awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
84	   lib.c run.c tran.c \
85	   makefile awk.1 testdir
86
87gitpush:
88	# only do this once:
89	# git remote add origin https://github.com/onetrueawk/awk.git
90	git push -u origin master
91
92names:
93	@echo $(LISTING)
94
95test check:
96	./REGRESS
97
98clean: testclean
99	rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
100
101cleaner: testclean
102	rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.*
103
104# This is a bit of a band-aid until we can invest some more time
105# in the test suite.
106testclean:
107	cd testdir; rm -fr arnold-fixes beebe devnull echo foo* \
108		glop glop1 glop2 lilly.diff tempbig tempsmall time
109
110# For the habits of GNU maintainers:
111distclean: cleaner
112