Files
paparazzi/sw/Makefile.ocaml
T
Gautier Hattenberger c158c856f3 [ocaml] use glib from gtk3 if gtk2 is not found (#3290)
Gtk3 doesn't support all features of gtk2 (or have a different interface), so if only gtk3 is found, GUI tools are not compiled, only CLI tools based only on glib.
If no gtk found, tools based on glib/gtk are not compiled.
Remove two old tools not used and not supported by gtk3.
2024-06-05 18:10:51 +02:00

68 lines
2.2 KiB
Makefile

# Hey Emacs, this is a -*- makefile -*-
#
# Copyright (C) 2013 Gautier Hattenberger
#
# This file is part of paparazzi.
#
# paparazzi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# paparazzi 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
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with paparazzi; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# General ocaml compiling tools and pprz lib
# error if PAPARAZZI_SRC is not set and trying to compile
ifneq ($(MAKECMDGOALS),clean)
ifeq ($(PAPARAZZI_SRC),)
$(error PAPARAZZI_SRC not set, please set it manually or invoke make from the toplevel paparazzi dir)
endif
endif
OCAML = ocaml
OCAMLC = ocamlfind ocamlc -safe-string -g -thread
OCAMLOPT = ocamlfind ocamlopt -safe-string -g -thread
OCAMLDEP = ocamlfind ocamldep
OCAMLMKLIB = ocamlmklib
OCAMLLEX=ocamllex
OCAMLYACC=ocamlyacc
OCAMLLIBDIR=$(shell $(OCAMLC) -where)
LIBPPRZLINKDIR = $(PAPARAZZI_HOME)/var/lib/ocaml
LIBPPRZDIR = $(PAPARAZZI_SRC)/sw/lib/ocaml
LIBPPRZCMA = $(LIBPPRZDIR)/lib-pprz.cma
LIBPPRZCMXA = $(LIBPPRZCMA:.cma=.cmxa)
XLIBPPRZCMA = $(LIBPPRZDIR)/xlib-pprz.cma
XLIBPPRZCMXA = $(XLIBPPRZCMA:.cma=.cmxa)
LIBPPRZLINKCMA = $(LIBPPRZLINKDIR)/pprzlink/lib-pprzlink.cma
LIBPPRZLINKCMXA = $(LIBPPRZLINKCMA:.cma=.cmxa)
OCAMLDLL = -dllpath $(LIBPPRZDIR),$(LIBPPRZLINKDIR)
OCAMLXDLL = -dllpath $(LIBPPRZDIR),$(LIBPPRZLINKDIR)
OCAMLPATH:=$(shell echo $(LIBPPRZLINKDIR):$(LIBPPRZDIR):$(OCAMLPATH))
export OCAMLPATH
# Test lablgtk version, use V2 if available, V3 otherwise
# disable ocaml/gtk tools if none ?
LABLGTK2_VER = $(shell ocamlfind query -p-format lablgtk2 2>/dev/null)
LABLGTK3_VER = $(shell ocamlfind query -p-format lablgtk3 2>/dev/null)
ifneq ($(LABLGTK2_VER),)
USE_LABELGTK = $(LABLGTK2_VER)
else
ifneq ($(LABLGTK3_VER),)
USE_LABELGTK = $(LABLGTK3_VER)
else
USE_LABELGTK=
endif
endif