| 1 |
# |
| 2 |
# Makefile for ANTLR 1.33 |
| 3 |
# |
| 4 |
# SOFTWARE RIGHTS |
| 5 |
# |
| 6 |
# We reserve no LEGAL rights to the Purdue Compiler Construction Tool |
| 7 |
# Set (PCCTS) -- PCCTS is in the public domain. An individual or |
| 8 |
# company may do whatever they wish with source code distributed with |
| 9 |
# PCCTS or the code generated by PCCTS, including the incorporation of |
| 10 |
# PCCTS, or its output, into commerical software. |
| 11 |
# |
| 12 |
# We encourage users to develop software with PCCTS. However, we do ask |
| 13 |
# that credit is given to us for developing PCCTS. By "credit", |
| 14 |
# we mean that if you incorporate our source code into one of your |
| 15 |
# programs (commercial product, research project, or otherwise) that you |
| 16 |
# acknowledge this fact somewhere in the documentation, research report, |
| 17 |
# etc... If you like PCCTS and have developed a nice tool with the |
| 18 |
# output, please mention that you developed it using PCCTS. In |
| 19 |
# addition, we ask that this header remain intact in our source code. |
| 20 |
# As long as these guidelines are kept, we expect to continue enhancing |
| 21 |
# this system and expect to make other tools available as they are |
| 22 |
# completed. |
| 23 |
# |
| 24 |
# ANTLR 1.33 |
| 25 |
# Terence Parr |
| 26 |
# Parr Research Corporation |
| 27 |
# with Purdue University |
| 28 |
# and AHPCRC, University of Minnesota |
| 29 |
# 1989-1995 |
| 30 |
# |
| 31 |
# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by |
| 32 |
# Ed Harfmann |
| 33 |
# Micro Data Base Systems |
| 34 |
# Lafayette, Indiana |
| 35 |
# |
| 36 |
SET=../support/set |
| 37 |
PCCTS_H=../h |
| 38 |
|
| 39 |
# |
| 40 |
# UNIX (default) |
| 41 |
# |
| 42 |
CC=cc |
| 43 |
ANTLR=../bin/antlr |
| 44 |
DLG=../bin/dlg |
| 45 |
OBJ_EXT=o |
| 46 |
OUT_OBJ = -o |
| 47 |
ANSI=-ansi |
| 48 |
AOTHER= |
| 49 |
CFLAGS= -O0 -g -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) |
| 50 |
# |
| 51 |
# SGI Users, use this CFLAGS |
| 52 |
# |
| 53 |
#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262 |
| 54 |
OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \ |
| 55 |
globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o $(OBJOTHER) |
| 56 |
|
| 57 |
antlr : $(OBJ) $(SRC) |
| 58 |
$(CC) $(CFLAGS) -o antlr $(OBJ) |
| 59 |
mv antlr ../bin |
| 60 |
|
| 61 |
# what files does PCCTS generate (both ANTLR and DLG) |
| 62 |
PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h |
| 63 |
|
| 64 |
SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \ |
| 65 |
hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c |
| 66 |
|
| 67 |
# |
| 68 |
# Don't worry about the ambiguity messages coming from antlr |
| 69 |
# for making antlr.c etc... [should be 10 of them, I think] |
| 70 |
# |
| 71 |
antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g |
| 72 |
$(ANTLR) -gh antlr.g $(AOTHER) |
| 73 |
|
| 74 |
antlr.o : antlr.c mode.h tokens.h |
| 75 |
|
| 76 |
scan.o : scan.c mode.h tokens.h |
| 77 |
|
| 78 |
scan.c mode.h: parser.dlg |
| 79 |
$(DLG) -C2 parser.dlg scan.c |
| 80 |
|
| 81 |
set.o : $(SET)/set.c |
| 82 |
$(CC) $(CFLAGS) -c -o set.o $(SET)/set.c |
| 83 |
|
| 84 |
|
| 85 |
# |
| 86 |
# ****** These next targets are common to UNIX and PC world ******** |
| 87 |
# |
| 88 |
|
| 89 |
#clean up all the intermediate files |
| 90 |
clean: |
| 91 |
rm -f *.$(OBJ_EXT) core |
| 92 |
|
| 93 |
#remove everything in clean plus the PCCTS files generated |
| 94 |
scrub: |
| 95 |
rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core |