CAMLP4O=camlp4o

OBJECTS = misc.cmo pcap_next.cmo pcap_loop.cmo \
pcap_dump_direct.cmo pcap_findalldevs.cmo \
pcap_open_offline.cmo

TARGETS = misc pcap_next pcap_loop \
pcap_dump_direct pcap_findalldevs \
pcap_open_offline

all: $(TARGETS)

$(TARGETS): $(OBJECTS)
	ocamlfind ocamlc -package pcap -linkpkg -o $@ $@.cmo

clean:
	rm -f *.cmo *.cmi $(TARGETS)

.SUFFIXES: .ml .cmo .cmi

.ml.cmo: 
	ocamlfind ocamlc -package pcap -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -c $<

