mutated_ocaml / testsuite / tests / lib-dynlink-native / Makefile


	@if [ -z "$(BYTECODE_ONLY)" ]; then \
	  $(MAKE) all; \

all: compile run sub/ sub/


compile: $(PLUGINS) main

	@printf " ... testing 'main'"
	@./main > result
	@$(DIFF) reference result > /dev/null || (echo " => failed" && exit 1)
	@echo " => passed"

main: api.cmx main.cmx
	@$(OCAMLOPT) -thread -o main -linkall unix.cmxa threads.cmxa dynlink.cmxa api.cmx main.cmx $(PTHREAD_LINK)

main_ext: api.cmx main.cmx factorial.$(O)
	@$(OCAMLOPT) -o main_ext dynlink.cmxa api.cmx main.cmx factorial.$(O)

sub/plugin3.cmx: sub/api.cmi sub/api.cmx sub/
	@(cd sub; mv api.cmx api.cmx.bak; $(OCAMLOPT) -c $(COMPFLAGS); mv api.cmx.bak api.cmx)

plugin2.cmx: api.cmx plugin.cmi plugin.cmx
	@(mv plugin.cmx plugin.cmx.bak; $(OCAMLOPT) -c $(COMPFLAGS); mv plugin.cmx.bak plugin.cmx)

sub/ sub/api.cmi sub/
	@(cd sub; $(OCAMLOPT) -c $(COMPFLAGS) $(SHARED)

sub/api.cmi: sub/api.mli
	@(cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.mli)

sub/api.cmx: sub/api.cmi sub/
	@(cd sub; $(OCAMLOPT) -c $(COMPFLAGS)

plugin.cmx: api.cmx plugin.cmi
sub/plugin.cmx: api.cmx
plugin4.cmx: api.cmx
main.cmx: api.cmx
plugin_ext.cmx: api.cmx
	@$(OCAMLOPT) -c $(COMPFLAGS) factorial.$(O) plugin_ext.cmx
	@$(OCAMLOPT) $(COMPFLAGS) -shared -o factorial.$(O) plugin_ext.cmx plugin4.cmx
	@$(OCAMLOPT) -shared -o unix.cmxa plugin4.cmx

packed1_client.cmx: packed1.cmx

pack_client.cmx: mypack.cmx

packed1.cmx: api.cmx
	@$(OCAMLOPT) -c $(COMPFLAGS) -for-pack Mypack

mypack.cmx: packed1.cmx
	@$(OCAMLOPT) $(COMPFLAGS) -S -pack -o mypack.cmx packed1.cmx

mylib.cmxa: plugin.cmx plugin2.cmx
	@$(OCAMLOPT) $(COMPFLAGS) -a -o mylib.cmxa plugin.cmx plugin2.cmx

factorial.$(O): factorial.c
	@$(OCAMLOPT) -c -ccopt "$(SHAREDCCCOMPOPTS)" factorial.c

	@cp result reference

clean: defaultclean
	@rm -f result *.so *.o *.cm* main main_ext *.exe *.s *.asm *.obj
	@rm -f *.a *.lib
	@rm -f sub/*.so sub/*.o sub/*.cm* sub/*.s sub/*.asm sub/*.obj

include $(BASEDIR)/makefiles/Makefile.common
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.