📄 makefile
字号:
JFLAGS=-classpath ../../../..JAVA=java $(JFLAGS)JAVAC=javac $(JFLAGS)JAVADOC=javadocJLEXFLAGS=-qJLEX=$(JAVA) -Xmx1g JFlex.Main $(JLEXFLAGS).SUFFIXES:.SUFFIXES: .lex .java.SUFFIXES: .java .class.PHONY: allall: compile.PHONY: cleanclean: classesclean.PHONY: allcleanallclean: compileclean.PHONY : compilecompile: javafiles classes.PHONY: compilecleancompileclean: classesclean javafilescleanLEXFILES=$(wildcard *.lex).PHONY: javafilesjavafiles: $(LEXFILES:.lex=.java) @# Write a bash script that will compile the files in the todo list @echo "#!/bin/bash" > tempCommand @# If the todo list doesn't exist, don't compile anything @echo "if [ -e tempChangedLexFileList ]" >> tempCommand @echo "then" >> tempCommand @# Make sure each file is only on the todo list once. @echo "sort tempChangedLexFileList | uniq > tempChangedLexFileListUniq" >> tempCommand @echo "FILES=\`cat tempChangedLexFileListUniq\`" >> tempCommand @# Compile the files. @echo "echo Make: Compiling: $$ FILES" >> tempCommand @echo "$(JLEX) $$ FILES" >> tempCommand @echo "for file in $$ FILES" >> tempCommand @echo "do" >> tempCommand @# Each generated java file needs to be compiled by the java compiler. @echo "echo \"$$ {file%.lex}.java\" >> tempChangedJavaFileList" >> tempCommand @echo "done" >> tempCommand @echo "fi" >> tempCommand @# Remove extra spaces in the script that follow the dollar signs. @sed "s/\$$ /\$$/" tempCommand > tempCommand.sh @# Make the script executable. @chmod +x tempCommand.sh @# Call the script @./tempCommand.sh @rm -f tempCommand tempCommand.sh tempChangedLexFileList tempChangedLexFileListUniq *~.lex.java: @#for each changed lex file, add it to the todo list. @echo "$<" >> tempChangedLexFileList.PHONY: javafilescleanjavafilesclean: @echo Make: Removing generated Lexer java files. @rm -f `find . -name "*.lex" | sed s/.lex/.java/`JAVAFILES=$(wildcard *.java).PHONY: classesclasses: javafiles $(JAVAFILES:.java=.class) @# Write a bash script that will compile the files in the todo list @echo "#!/bin/bash" > tempCommand @# If the todo list doesn't exist, don't compile anything @echo "if [ -e tempChangedJavaFileList ]" >> tempCommand @echo "then" >> tempCommand @# Make sure each file is only on the todo list once. @echo "sort tempChangedJavaFileList | uniq > tempChangedJavaFileListUniq" >> tempCommand @echo "FILES=\`cat tempChangedJavaFileListUniq\`" >> tempCommand @# Compile the files. @echo "echo Make: Compiling: $$ FILES" >> tempCommand @echo "$(JAVAC) $$ FILES" >> tempCommand @echo "fi" >> tempCommand @# Remove extra spaces in the script that follow the dollar signs. @sed "s/\$$ /\$$/" tempCommand > tempCommand.sh @# Make the script executable. @chmod +x tempCommand.sh @# Call the script @./tempCommand.sh @rm -f tempCommand tempCommand.sh tempChangedJavaFileList tempChangedJavaFileListUniq.java.class: @#for each changed java file, add it to the todo list. @echo "$<" >> tempChangedJavaFileList.PHONY: classescleanclassesclean: junkclean @echo Make: Removing Lexer class files @rm -f *.class.PHONY: junkcleanjunkclean: @echo Make: Removing Lexer detritus. @rm -f *.bak *~ ~* core temp*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -