# Goalfile parser # Copyright (C) 2019 Richard W.M. Jones # Copyright (C) 2019 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. OBJECTS = \ config.cmx \ utils.cmx \ cmdline.cmx \ ast.cmx \ eval.cmx \ parser.cmx \ lexer.cmx \ parse.cmx \ main.cmx all: goals clean: rm -f *~ rm -f *.cmi *.cmo *.cmx *.o rm -f parser.ml parser.mli lexer.ml parser.conflicts stamp-parser rm -f goals OCAMLPACKAGES = -package str,unix OCAMLFLAGS = -g -safe-string -warn-error CDEFLMPSUVYZX+52-3 goals: $(OBJECTS) @OCAMLFIND@ opt $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg $^ -o $@ %.cmi: %.mli @OCAMLFIND@ c $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ %.cmo: %.ml @OCAMLFIND@ c $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ %.cmx: %.ml @OCAMLFIND@ opt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ parser.ml parser.mli: stamp-parser stamp-parser: parser.mly @MENHIR@ --explain $< # Hack required to get includes working. echo 'val lexer_read : (Lexing.lexbuf -> token) option ref' >> parser.mli touch $@ lexer.ml: lexer.mll lexer.cmi parser.ml @OCAMLLEX@ $< depend: .depend .depend: parser.mly lexer.mll *.mli rm -f $@ $@-t @MENHIR@ --depend parser.mly > $@-t ocamldep lexer.mll *.ml *.mli >> $@-t mv $@-t $@ -include .depend Makefile: Makefile.in ../config.status ../config.status $@ config.ml: config.ml.in ../config.status ../config.status $@ .PHONY: all clean depend # Doesn't build all *.cmi files before *.cmo/cmx files: #.NOTPARALLEL: