📄 makefile.unx
字号:
############################################################### Copyright (c) 1993-1995 by Paul Long All rights reserved.################################################################ UNIX makefile for Metre# (Tested with UNIX make.)## Initially set up for the typical UNIX configuration of Gnu C compiler# and flex/bison, but to use the parser files included in the# distribution (not regenerate them).## To make Metre: make -f makefile.unx metre# Mtree: make -f makefile.unx mtree# both: make -f makefile.unx# To test Metre: make -f makefile.unx metre.tst# Mtree: make -f makefile.unx mtree.tst# both: make -f makefile.unx all.tst# To delete# intermediate files: make -f makefile.unx clean# Temporary file used when testing a tool.TMP_FILE=tmp.tmp## IF Sun ANSI C compiler:#CC=acc#CFLAGS=-w# ELSE IF Gnu compiler:CC=gccCFLAGS=-ansi -w## IF AT&T lex/yacc:#LEX=lex#YACC=yacc#YFLAGS=-d# ELSE IF flex/bison:LEX=flexYACC=bisonYFLAGS= -y -d## IF be able to regenerate parser files (needed only if you modify parser):#LEXYY=lex.yy#YTAB=y.tab#MOVE_YTABH=mv $(YTAB).h ytab.h## DEL_LEXYACC_OUT is for cleaning up intermediate parser files since you## must be able to regenerate them.## Note: This will delete the ytab.h file included in the Metre distribution.## Therefore, make sure you have some kind of back up for this file if you## think you may want to go back to using the parser files that I distribute## with Metre (ytab.c, ytab.h, and lex_yy.c).#DEL_LEXYACC_OUT=rm -f $(LEXYY).c $(YTAB).c $(YTAB).h ytab.h# ELSE IF use existing parser files (recommended):LEXYY=lex_yyYTAB=ytabLEX=@echo "*** lex not executed ***"YACC=@echo "*** yacc not executed ***"MOVE_YTABH=DEL_LEXYACC_OUT=# Dummy target to make both tools.all: metre mtreemetre: metrules.o $(YTAB).o $(LEXYY).o $(CC) -o metre metrules.o $(YTAB).o $(LEXYY).o -lmmtree: trerules.o $(YTAB).o $(LEXYY).o $(CC) -o mtree trerules.o $(YTAB).o $(LEXYY).o$(YTAB).o: $(YTAB).c metreint.h $(CC) $(CFLAGS) -c $(YTAB).c$(LEXYY).o: $(LEXYY).c ytab.h metreint.h $(CC) $(CFLAGS) -c $(LEXYY).cmetrules.o: metrules.c metre.h $(CC) $(CFLAGS) -c metrules.ctrerules.o: trerules.c metre.h $(CC) $(CFLAGS) -c trerules.c$(YTAB).c ytab.h: gram.y $(YACC) $(YFLAGS) gram.y $(MOVE_YTABH)$(LEXYY).c: scan.l $(LEX) scan.lmetreint.h: metre.h# Test both or individually.all.tst: metre.tst mtree.tstmetre.tst: metre ./metre -DBOOLEAN=int -Dva_list=int -H -a metrules.c >$(TMP_FILE) -diff metrules.out $(TMP_FILE) rm -f $(TMP_FILE)mtree.tst: mtree ./mtree -DBOOLEAN=int -l -t -rrules trerules.c >$(TMP_FILE) -diff trerules.out $(TMP_FILE) rm -f $(TMP_FILE)# Clean up intermediate files.clean: -$(DEL_LEXYACC_OUT) -rm -f *.o
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -