diff --git a/conf/Makefile.sim b/conf/Makefile.sim index d494e44845..7f95aad73d 100644 --- a/conf/Makefile.sim +++ b/conf/Makefile.sim @@ -27,10 +27,12 @@ # this should not be needed SRC_ARCH = arch/sim +include $(PAPARAZZI_SRC)/sw/Makefile.ocaml + CC = gcc -OCAMLC = ocamlc SIMDIR = $(PAPARAZZI_SRC)/sw/simulator -CAMLINCLUDES = $(shell ocamlfind query -r -i-format lablgtk2) -I $(PAPARAZZI_SRC)/sw/lib/ocaml -I $(SIMDIR) $(shell ocamlfind query -r -i-format xml-light) +CAMLINCLUDES = -I $(LIBPPRZDIR) -I $(SIMDIR) -I $(OBJDIR) +PKGCOMMON = unix,str,xml-light,glibivy,lablgtk2 SIMSITLML = $(OBJDIR)/simsitl.ml MYGTKINITCMO = myGtkInit.cmo SITLCMA = $(SIMDIR)/sitl.cma @@ -65,10 +67,14 @@ $(TARGET).objs = $($(TARGET).objso:%.S=$(OBJDIR)/%.o) all compile: $(OBJDIR)/simsitl +# shared library of the C autopilot part +autopilot.so : $($(TARGET).objs) + @echo BUILD $@ + $(Q)$(CC) -shared -o $(OBJDIR)/$@ $^ -$(OBJDIR)/simsitl : $($(TARGET).objs) $(SITLCMA) $(SIMSITLML) +$(OBJDIR)/simsitl : autopilot.so $(SITLCMA) $(SIMSITLML) @echo LD $@ - $(Q)$(OCAMLC) -g -custom $(CAMLINCLUDES) -o $@ unix.cma str.cma xml-light.cma glibivy-ocaml.cma lib-pprz.cma lablgtk.cma $($(TARGET).objs) $(MYGTKINITCMO) $(SITLCMA) $(SIMSITLML) + $(Q)$(OCAMLFIND) $(OCAMLC) -g $(CAMLINCLUDES) -o $@ -package $(PKGCOMMON) -linkpkg $(OCAMLDLL) $(LIBPPRZCMA) $(MYGTKINITCMO) $^ -dllpath $(OBJDIR) -dllpath $(SIMDIR) # The id of the A/C is hardcoded in the code (to be improved with dynlink ?) diff --git a/sw/Makefile.ocaml b/sw/Makefile.ocaml index 70b8699ce8..3073724ed4 100644 --- a/sw/Makefile.ocaml +++ b/sw/Makefile.ocaml @@ -28,10 +28,10 @@ OCAMLOPT = ocamlopt OCAMLDEP = ocamldep OCAMLFIND = ocamlfind LIBPPRZDIR = $(PAPARAZZI_SRC)/sw/lib/ocaml -INCLUDES = -I $(LIBPPRZDIR) LIBPPRZCMA = $(LIBPPRZDIR)/lib-pprz.cma -LIBPPRZCMXA=$(LIBPPRZCMA:.cma=.cmxa) -XLIBPPRZCMA=$(LIBPPRZDIR)/xlib-pprz.cma -XLIBPPRZCMXA=$(XLIBPPRZCMA:.cma=.cmxa) +LIBPPRZCMXA = $(LIBPPRZCMA:.cma=.cmxa) +XLIBPPRZCMA = $(LIBPPRZDIR)/xlib-pprz.cma +XLIBPPRZCMXA = $(XLIBPPRZCMA:.cma=.cmxa) OCAMLDLL = -dllpath $(LIBPPRZDIR) OCAMLXDLL = -dllpath $(LIBPPRZDIR) + diff --git a/sw/airborne/Makefile b/sw/airborne/Makefile index 6062f64897..258ae943c8 100644 --- a/sw/airborne/Makefile +++ b/sw/airborne/Makefile @@ -50,10 +50,6 @@ ifneq ($(MAKECMDGOALS),clean) # sort cflags and sources to throw out duplicates # - #$(info CFLAGS_orig = $($(TARGET).CFLAGS)) - #$(info CFLAGS_sort = $(sort $($(TARGET).CFLAGS))) - #$(info srcs_orig = $($(TARGET).srcs)) - #$(info srcs_sort = $(sort $($(TARGET).srcs))) $(TARGET).CFLAGS := $(sort $($(TARGET).CFLAGS)) $(TARGET).srcs := $(sort $($(TARGET).srcs)) endif diff --git a/sw/ground_segment/cockpit/Makefile b/sw/ground_segment/cockpit/Makefile index 64d24ea629..5330cf4154 100644 --- a/sw/ground_segment/cockpit/Makefile +++ b/sw/ground_segment/cockpit/Makefile @@ -40,7 +40,7 @@ LIBS= lablglade.cma lablgnomecanvas.cma $(OCAMLDLL) $(LIBPPRZCMA) $(OCAMLXDLL) $ CMXA=$(LIBS:.cma=.cmxa) INCLUDES= -I $(LIBPPRZDIR) -I ../multimon -PKGCOMMON=unix,str,lablgtk2,ivy,xml-light,netstring,netclient,threads +PKGCOMMON=unix,str,lablgtk2,glibivy,xml-light,netstring,netclient,threads ML= gtk_setting_time.ml gtk_strip.ml horizon.ml strip.ml gtk_save_settings.ml saveSettings.ml page_settings.ml pages.ml speech.ml plugin.ml sectors.ml map2d.ml editFP.ml live.ml particules.ml papgets.ml gcs.ml MAIN=gcs diff --git a/sw/ground_segment/joystick/Makefile b/sw/ground_segment/joystick/Makefile index 94fb7be2dc..11eeb322b1 100644 --- a/sw/ground_segment/joystick/Makefile +++ b/sw/ground_segment/joystick/Makefile @@ -28,12 +28,10 @@ include ../../Makefile.ocaml TOOLSDIR = ../../tools OCAMLINCLUDES= -I $(LIBPPRZDIR) -I $(TOOLSDIR) -#OCAMLINCLUDES= -I $(LIBPPRZDIR) $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) $(shell ocamlfind query -r -i-format ivy) -I $(TOOLSDIR) -PKGCOMMON=unix,str,lablgtk2,ivy,xml-light +PKGCOMMON=unix,str,lablgtk2,glibivy,xml-light LIBPPRZCMA=$(LIBPPRZDIR)/lib-pprz.cma # apparently on OSX `sdl-config --libs` also has -lSDLmain which we don't want -#ML_SDL_LFLAGS = $(foreach u,$(shell sdl-config --libs),-cclib $(u)) ML_SDL_LFLAGS = $(foreach u,$(shell pkg-config sdl --libs-only-L) -lSDL,-cclib $(u)) libSDL.so INCLUDES += -I `ocamlc -where` diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index e7ec0474ff..3969976304 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -37,7 +37,7 @@ CONF = ../../../conf VAR = ../../../var INCLUDES= -I $(LIBPPRZDIR) -I ../multimon -PKGCOMMON=unix,str,lablgtk2,ivy,xml-light,netstring,netclient +PKGCOMMON=unix,str,lablgtk2,glibivy,xml-light,netstring,netclient LIBMULTIMONCMA=../multimon/multimon.cma LIBMULTIMONDLL= multimon.cma -dllpath $(PAPARAZZI_SRC)/sw/ground_segment/multimon diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile index 21c926fac6..540a64a151 100644 --- a/sw/lib/ocaml/Makefile +++ b/sw/lib/ocaml/Makefile @@ -50,7 +50,7 @@ endif INCLUDES= PKGCOMMON=xml-light,netclient,ivy,lablgtk2 XINCLUDES= -XPKGCOMMON=lablgtk2,xml-light,ivy +XPKGCOMMON=lablgtk2,xml-light,glibivy SRC = fig.ml debug.ml base64.ml serial.ml ocaml_tools.ml expr_syntax.ml expr_parser.ml expr_lexer.ml extXml.ml env.ml xml2h.ml latlong.ml egm96.ml srtm.ml http.ml maps_support.ml gm.ml iGN.ml geometry_2d.ml cserial.o convert.o ubx.ml pprz.ml xbee.ml logpprz.ml xmlCom.ml os_calls.ml editAirframe.ml defivybus.ml CMO = $(SRC:.ml=.cmo) diff --git a/sw/simulator/Makefile b/sw/simulator/Makefile index 83f6f22f58..a61d583aae 100644 --- a/sw/simulator/Makefile +++ b/sw/simulator/Makefile @@ -33,7 +33,8 @@ include ../../conf/Makefile.local include ../Makefile.ocaml OCAMLC += -g -PKGCOMMON=unix,str,lablgtk2,ivy,xml-light +INCLUDES = -I $(LIBPPRZDIR) +PKGCOMMON=unix,str,lablgtk2,glibivy,xml-light SIMML = stdlib.ml data.ml flightModel.ml gps.ml SIMHML = $(SIMML) hitl.ml sim.ml diff --git a/sw/tools/Makefile b/sw/tools/Makefile index cb959ef880..ab2a8df10f 100644 --- a/sw/tools/Makefile +++ b/sw/tools/Makefile @@ -24,6 +24,9 @@ Q=@ include ../Makefile.ocaml +INCLUDES = -I $(LIBPPRZDIR) +PKGCOMMON=unix,str,xml-light,ivy + all: gen_common.cmo gen_aircraft.out gen_airframe.out gen_messages2.out gen_messages.out gen_ubx.out gen_mtk.out gen_flight_plan.out gen_radio.out gen_periodic.out gen_settings.out gen_xsens.out gen_modules.out gen_autopilot.out gen_abi.out find_free_msg_id.out gen_srtm.out mergelogs FP_CMO = fp_proc.cmo gen_flight_plan.cmo @@ -31,15 +34,15 @@ ABS_FP = $(FP_CMO:%=$$PAPARAZZI_SRC/sw/tools/%) gen_flight_plan.out : $(FP_CMO) @echo OL $@ - $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package unix,str,xml-light,ivy -linkpkg $(OCAMLDLL) lib-pprz.cma $^ + $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package $(PKGCOMMON) -linkpkg $(OCAMLDLL) lib-pprz.cma $^ gen_srtm.out : gen_srtm.ml gen_common.cmo $(LIBPPRZCMA) @echo OC $@ - $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package unix,str,xml-light,netclient,ivy -linkpkg $(OCAMLDLL) lib-pprz.cma $< + $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package $(PKGCOMMON),netclient -linkpkg $(OCAMLDLL) lib-pprz.cma $< %.out : %.ml gen_common.cmo $(LIBPPRZCMA) @echo OC $< - $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package unix,str,xml-light,ivy -linkpkg $(OCAMLDLL) lib-pprz.cma gen_common.cmo $< + $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -o $@ -package $(PKGCOMMON) -linkpkg $(OCAMLDLL) lib-pprz.cma gen_common.cmo $< # disable this for now and use the compiled bytecode #@cat ../../pprz_src_test.sh > $@ @@ -48,11 +51,11 @@ gen_srtm.out : gen_srtm.ml gen_common.cmo $(LIBPPRZCMA) %.cmo : %.ml @echo OC $< - $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -package xml-light -c $< + $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -package $(PKGCOMMON) lib-pprz.cma -c $< %.cmi : %.mli @echo OC $< - $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -package xml-light -c $< + $(Q)$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -package $(PKGCOMMON) lib-pprz.cma -c $< # dependency on lib-pprz gen_flight_plan.out gen_srtm.out : $(LIBPPRZCMA)