Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 1 | # /**************************************************************** |
| 2 | # Copyright (C) Lucent Technologies 1997 |
| 3 | # All Rights Reserved |
Arnold D. Robbins | 795a06b | 2019-07-28 05:51:52 -0600 | [diff] [blame] | 4 | # |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 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. |
Arnold D. Robbins | 795a06b | 2019-07-28 05:51:52 -0600 | [diff] [blame] | 14 | # |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 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 | |
enh-google | 7b245a0 | 2020-02-28 03:18:29 -0800 | [diff] [blame] | 25 | CFLAGS = -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 26 | CFLAGS = -g |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 27 | CFLAGS = |
Brian Kernighan | 0f4e1ba | 2018-08-24 09:09:59 -0400 | [diff] [blame] | 28 | CFLAGS = -O2 |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 29 | |
Brian Kernighan | 0f4e1ba | 2018-08-24 09:09:59 -0400 | [diff] [blame] | 30 | # compiler options |
Arnold D. Robbins | 32093f5 | 2018-08-22 20:40:26 +0300 | [diff] [blame] | 31 | #CC = gcc -Wall -g -Wwrite-strings |
Arnold D. Robbins | 32093f5 | 2018-08-22 20:40:26 +0300 | [diff] [blame] | 32 | #CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing |
| 33 | #CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov |
Arnold D. Robbins | 961eec1 | 2019-10-24 09:42:51 -0400 | [diff] [blame] | 34 | HOSTCC = gcc -g -Wall -pedantic -Wcast-qual |
Arnold D. Robbins | 55edb1b | 2019-03-12 21:54:57 +0200 | [diff] [blame] | 35 | CC = $(HOSTCC) # change this is cross-compiling. |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 36 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 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. |
zoulasc | 94e4c04 | 2020-02-18 14:20:27 -0500 | [diff] [blame] | 39 | YACC = bison -d |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 40 | |
| 41 | OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o |
| 42 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 43 | SOURCE = awk.h awkgram.tab.c awkgram.tab.h proto.h awkgram.y lex.c b.c main.c \ |
Arnold D. Robbins | 795a06b | 2019-07-28 05:51:52 -0600 | [diff] [blame] | 44 | maketab.c parse.c lib.c run.c tran.c proctab.c |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 45 | |
| 46 | LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \ |
Arnold D. Robbins | 795a06b | 2019-07-28 05:51:52 -0600 | [diff] [blame] | 47 | lib.c run.c tran.c |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 48 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 49 | SHIP = README LICENSE FIXES $(SOURCE) awkgram.tab.[ch].bak makefile \ |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 50 | awk.1 |
| 51 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 52 | a.out: awkgram.tab.o $(OFILES) |
| 53 | $(CC) $(CFLAGS) awkgram.tab.o $(OFILES) $(ALLOC) -lm |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 54 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 55 | $(OFILES): awk.h awkgram.tab.h proto.h |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 56 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 57 | awkgram.tab.c awkgram.tab.h: awk.h proto.h awkgram.y |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 58 | $(YACC) $(YFLAGS) awkgram.y |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 59 | |
| 60 | proctab.c: maketab |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 61 | ./maketab awkgram.tab.h >proctab.c |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 62 | |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 63 | maketab: awkgram.tab.h maketab.c |
nee-san | c83d943 | 2019-03-12 22:52:17 +0300 | [diff] [blame] | 64 | $(HOSTCC) $(CFLAGS) maketab.c -o maketab |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 65 | |
| 66 | bundle: |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 67 | @cp awkgram.tab.h awkgram.tab.h.bak |
| 68 | @cp awkgram.tab.c awkgram.tab.c.bak |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 69 | @bundle $(SHIP) |
| 70 | |
| 71 | tar: |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 72 | @cp awkgram.tab.h awkgram.tab.h.bak |
| 73 | @cp awkgram.tab.c awkgram.tab.c.bak |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 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 | |
| 81 | gitadd: |
Brian Kernighan | 3ed9e24 | 2018-08-15 10:45:03 -0400 | [diff] [blame] | 82 | git add README LICENSE FIXES \ |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 83 | awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \ |
| 84 | lib.c run.c tran.c \ |
Arnold D. Robbins | ab911ab | 2019-06-24 01:10:24 -0600 | [diff] [blame] | 85 | makefile awk.1 testdir |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 86 | |
| 87 | gitpush: |
Arnold D. Robbins | 795a06b | 2019-07-28 05:51:52 -0600 | [diff] [blame] | 88 | # only do this once: |
Brian Kernighan | 3ed9e24 | 2018-08-15 10:45:03 -0400 | [diff] [blame] | 89 | # git remote add origin https://github.com/onetrueawk/awk.git |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 90 | git push -u origin master |
| 91 | |
| 92 | names: |
| 93 | @echo $(LISTING) |
| 94 | |
Arnold D. Robbins | ab911ab | 2019-06-24 01:10:24 -0600 | [diff] [blame] | 95 | test check: |
| 96 | ./REGRESS |
| 97 | |
| 98 | clean: testclean |
Brian Kernighan | 87b9493 | 2012-12-22 10:35:39 -0500 | [diff] [blame] | 99 | rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c |
Brian Kernighan | 3ed9e24 | 2018-08-15 10:45:03 -0400 | [diff] [blame] | 100 | |
Arnold D. Robbins | ab911ab | 2019-06-24 01:10:24 -0600 | [diff] [blame] | 101 | cleaner: testclean |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 102 | rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda proctab.c awkgram.tab.* |
Arnold D. Robbins | ab911ab | 2019-06-24 01:10:24 -0600 | [diff] [blame] | 103 | |
| 104 | # This is a bit of a band-aid until we can invest some more time |
| 105 | # in the test suite. |
| 106 | testclean: |
Arnold D. Robbins | 3b42cfa | 2020-10-13 20:52:43 +0300 | [diff] [blame] | 107 | cd testdir; rm -fr arnold-fixes beebe devnull echo foo* \ |
Arnold D. Robbins | cebda36 | 2019-07-26 12:57:48 +0300 | [diff] [blame] | 108 | glop glop1 glop2 lilly.diff tempbig tempsmall time |
Arnold D. Robbins | 8b92a4a | 2019-10-24 09:44:00 -0400 | [diff] [blame] | 109 | |
| 110 | # For the habits of GNU maintainers: |
Arnold D. Robbins | 07f0438 | 2020-07-30 17:12:45 +0300 | [diff] [blame] | 111 | distclean: cleaner |