#
# This file is part of OCaml-Java compiler.
# Copyright (C) 2007-2015 Xavier Clerc.
#
# OCaml-Java compiler is free software; you can redistribute it and/or modify
# it under the terms of the Q Public License v1.0 as published by
# Trolltech (with a change to choice of law).
#
# OCaml-Java compiler 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
# Q Public License for more details.
#
# You should have received a copy of the Q Public License
# along with this program.  If not, see
# <http://opensource.org/licenses/QPL-1.0>.
#

TOPDIR=../../..
LIBNAME=labltk
include $(TOPDIR)/config/Makefile
INSTALLDIR=$(LIBDIR)/$(LIBNAME)

OCAMLJAVA=$(TOPDIR)/ocamljava.opt
COMPFLAGS=-g -java-package 'ocaml.otherlibs.labltk' -nostdlib -I $(TOPDIR)/stdlib -I $(TOPDIR)/otherlibs/unix -I $(TOPDIR)/otherlibs/str -I ../labltk -I ../support

OBJS=fileselect.cmj balloon.cmj shell.cmj jpf_font.cmj

all: jpflib.cmja

jpflib.cmja: $(patsubst %.cmj,%.cmi,$(CMJ_FILES)) $(OBJS)
	$(OCAMLJAVA) -a -o jpflib.cmja $(OBJS)

install:
	cp jpflib.cmja jpflib.ja $(OBJS) $(INSTALLDIR)

clean:
	rm -f *.cm* *.jo *.ja

.SUFFIXES:
.SUFFIXES: .mli .ml .cmi .cmj

.mli.cmi:
	$(OCAMLJAVA) -c $(COMPFLAGS) $<

.ml.cmj:
	$(OCAMLJAVA) -c $(COMPFLAGS) $<
