Advertisement
tobast

OCaml sysdig makefile

Oct 27th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.24 KB | None | 0 0
  1. # Makefile for sysdig-simulator by Théophile Bastian <[email protected]>
  2.  
  3. CMP=ocamlopt
  4. YACC=menhir
  5. LEX=ocamllex
  6. CMPFLAGS=
  7. CMPLIBS=-I netlist
  8. TARGET=simcomp
  9. OBJS= netlist/netlist_ast.cmx \
  10.     netlist/netlist_parser.mly.cmx \
  11.     netlist/netlist_lexer.mll.cmx \
  12.     netlist/netlist.cmx \
  13.     netlist/netlist_printer.cmx \
  14.     parameters.cmx \
  15.     cpp.cmx \
  16.     transformNetlist.cmx \
  17.     depGraph.cmx \
  18.     genCode.cmx \
  19.     skeleton.cmx \
  20.     main.cmx
  21.  
  22. #########################################################################
  23.  
  24. OBJS_OUT1= $(OBJS:.mly.cmx=.cmx)
  25. OBJS_OUT2= $(OBJS_OUT1:.mll.cmx=.cmx)
  26. OBJS_OUT3= $(OBJS_OUT2:.mll.cmo=.cmx)
  27. OBJS_OUT= $(OBJS_OUT3:.mly.cmo=.cmo)
  28.  
  29. all: $(TARGET)
  30.  
  31. $(TARGET): $(YACCOBJS) $(OBJS)
  32.     $(CMP) $(CMPLIBS) $(CMPFLAGS) -o $@ $(OBJS_OUT)
  33.     @rm cpp.ml # Not regenerated if not deleted
  34.  
  35. %.cmx: %.ml
  36.     ([ -f "$<i" ] && $(CMP) $(CMPLIBS) $(CMPFLAGS) -c "$<i" ; /usr/bin/true)
  37.     $(CMP) $(CMPLIBS) $(CMPFLAGS) -c $<
  38.  
  39. cpp.ml: genCpp.sh
  40.     bash ./genCpp.sh > cpp.ml
  41.  
  42. %.mly.cmx: %.mly
  43.     $(YACC) $<
  44.     $(CMP) $(CMPLIBS) $(CMPFLAGS) -c $*.mli
  45.     $(CMP) $(CMPLIBS) $(CMPFLAGS) -c $*.ml
  46.  
  47. %.mll.cmx: %.mll
  48.     $(LEX) $<
  49.     $(CMP) $(CMPLIBS) $(CMPFLAGS) -c $*.ml
  50.  
  51. .PHONY: clean
  52.  
  53. clean:
  54.     rm -f *.cmi *.cmx *.cmo *.mly.ml *.mly.mli *.o cpp.ml
  55.     @make -C netlist clean
  56.  
  57. mrproper: clean
  58.     rm -f $(TARGET)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement