Find ocaml library paths with ocamlfind and compile C with fPIC flag on 64 bit OS

This commit is contained in:
Eric Parsonage
2010-11-19 06:28:14 +00:00
committed by Felix Ruess
parent 2eee0b024d
commit f0f445c7c2
+9 -2
View File
@@ -23,6 +23,13 @@
# Quiet compilation # Quiet compilation
Q=@ Q=@
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
FPIC = -ccopt -fPIC
else
FPIC =
endif
include ../../conf/Makefile.local include ../../conf/Makefile.local
SIMML = stdlib.ml data.ml flightModel.ml gps.ml SIMML = stdlib.ml data.ml flightModel.ml gps.ml
@@ -35,7 +42,7 @@ SIMSCMX=$(SIMSML:%.ml=%.cmx)
OCAMLC = ocamlc -g OCAMLC = ocamlc -g
OCAMLOPT=ocamlopt OCAMLOPT=ocamlopt
INCLUDES= -I +lablgtk2 -I ../lib/ocaml -I +xml-light INCLUDES= $(shell ocamlfind query -r -i-format lablgtk2) -I ../lib/ocaml $(shell ocamlfind query -r -i-format xml-light)
AIRBORNE = ../airborne AIRBORNE = ../airborne
VARINCLUDE=$(PAPARAZZI_HOME)/var/include VARINCLUDE=$(PAPARAZZI_HOME)/var/include
@@ -70,7 +77,7 @@ diffusion : stdlib.cmo diffusion.cmo
%.o : %.c %.o : %.c
@echo OC $< @echo OC $<
$(Q)$(OCAMLC) -c $< $(Q)$(OCAMLC) $(FPIC) -c $<
%.cmx : %.ml %.cmx : %.ml
@echo OOC $< @echo OOC $<