Makefile.in 1.63 KB
Newer Older
pj2m's avatar
pj2m committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
include ../config/Makefile

LOG = -DDEBUG=\"@DEBUG@\" -DINFO=\"@INFO@\" -DMESSAGE=\"@MESSAGE@\" -DWARNING=\"@WARNING@\"

opt_gtk : ui.ml ui.cmx gui.cmx main.cmx ../bin/dep2pict.opt

opt : main.cmx ../bin/dep2pict.opt

ui.ml : dep2pict.glade
	sed 's/<property name="invisible_char">&#x25CF;<\/property>//g' dep2pict.glade > glade.tmp
	mv glade.tmp dep2pict.glade.ml
	lablgladecc2 dep2pict.glade.ml > ui.ml
	rm dep2pict.glade.ml
	sed 's|dep2pict.glade.ml|$(DATA_DIR)dep2pict.glade|g' ui.ml > ui.tmp
	mv ui.tmp ui.ml
	
ui.cmx : ui.ml
	ocamlopt -c $(LABLGTK_OPT) ui.ml
	
DEP_OPT= unix.cmxa str.cmxa $(LABLGTK_OPT) $(XML_LIGHT_OPT) $(DEP2PICT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT)
DEP_OPT_LIGHT= unix.cmxa str.cmxa $(LABLGTK_OPT_LIGHT) $(XML_LIGHT_OPT) $(DEP2PICT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT)

gui.cmx : gui.ml ui.cmx 
	ocamlopt -c -pp 'camlp4o pa_macro.cmo -DBUILD_GUI -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT) ui.cmx gui.ml

main.cmx : main.ml
ifeq (@BUILD_GUI@,yes)
	ocamlopt -c -pp 'camlp4o pa_macro.cmo -DBUILD_GUI -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT) ui.cmx gui.cmx main.ml
else
	ocamlopt -c -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT) main.ml
endif



../bin/dep2pict.opt : main.cmx
	mkdir -p ../bin
ifeq (@BUILD_GUI@,yes)
	ocamlopt -o ../bin/dep2pict.opt -pp 'camlp4o pa_macro.cmo -DBUILD_GUI -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT) ui.cmx gui.cmx main.cmx
else
	ocamlopt -o ../bin/dep2pict.opt -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT_LIGHT) main.cmx
endif