diff --git a/conf/Makefile.sim b/conf/Makefile.sim index ac4d378ee1..3b5315cf8d 100644 --- a/conf/Makefile.sim +++ b/conf/Makefile.sim @@ -45,20 +45,13 @@ Q=@ # End of configuration part. # -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -fPIC -else - FPIC = -endif - INCLUDES += -I $(shell $(OCAMLC) -where) CFLAGS = -W -Wall CFLAGS += $(INCLUDES) CFLAGS += $($(TARGET).CFLAGS) CFLAGS += $(LOCAL_CFLAGS) -CFLAGS += $(FPIC) +CFLAGS += -fPIC CFLAGS += -O2 CFLAGS += -g CFLAGS += -std=gnu99 diff --git a/sw/ground_segment/cockpit/Makefile b/sw/ground_segment/cockpit/Makefile index 84703ccffa..b2d07e27c9 100644 --- a/sw/ground_segment/cockpit/Makefile +++ b/sw/ground_segment/cockpit/Makefile @@ -23,15 +23,7 @@ # Quiet compilation Q=@ -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC=-fPIC - OCAMLCFLAGS=-thread -ccopt -fPIC -else - FPIC= - OCAMLCFLAGS=-thread -endif -FPIC=-fPIC +OCAMLCFLAGS=-thread -ccopt -fPIC include ../../Makefile.ocaml @@ -100,7 +92,7 @@ clean: CC = gcc -CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags` $(FPIC) +CFLAGS=-g -O2 -Wall `pkg-config gtk+-2.0 --cflags` -fPIC LDFLAGS=`pkg-config gtk+-2.0 --libs` -s -lglibivy diff --git a/sw/ground_segment/joystick/Makefile b/sw/ground_segment/joystick/Makefile index ce13743102..5924ee2d60 100644 --- a/sw/ground_segment/joystick/Makefile +++ b/sw/ground_segment/joystick/Makefile @@ -29,18 +29,11 @@ TOOLSDIR = ../../tools CC = gcc -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC=-fpic -else - FPIC= -endif - OCAMLINCLUDES= -I $(TOOLSDIR) PKG = -package pprz,glibivy LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz -GLIB_CFLAGS = -Wall $(shell pkg-config glib-2.0 --cflags) $(FPIC) +GLIB_CFLAGS = -Wall $(shell pkg-config glib-2.0 --cflags) -fPIC GLIB_LDFLAGS = $(shell pkg-config glib-2.0 --libs) -lglibivy # apparently on OSX `sdl-config --libs` also has -lSDLmain which we don't want diff --git a/sw/ground_segment/lpc21iap/Makefile b/sw/ground_segment/lpc21iap/Makefile index d23ffc95b9..19ffb61af5 100644 --- a/sw/ground_segment/lpc21iap/Makefile +++ b/sw/ground_segment/lpc21iap/Makefile @@ -21,20 +21,13 @@ OD = objdump RM = rm TAR = tar -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC=-fPIC -else - FPIC= -endif - UNAME = $(shell uname -s) ifeq ("$(UNAME)","Darwin") LIBRARYS = $(shell if test -d /opt/paparazzi/lib; then echo "-L/opt/paparazzi/lib"; elif test -d /opt/local/lib; then echo "-L/opt/local/lib"; fi) INCLUDES = $(shell if test -d /opt/paparazzi/include; then echo "-I/opt/paparazzi/include"; elif test -d /opt/local/include; then echo "-I/opt/local/include"; fi) endif -CFLAGS = -Wall -g $(FPIC) $(INCLUDES) $(LIBRARYS) +CFLAGS = -Wall -g -fPIC $(INCLUDES) $(LIBRARYS) SOURCES = lpc21iap.c elf.c lpcusb.c diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index 814ea6b996..95cd37f477 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -23,14 +23,6 @@ # Quiet Q=@ -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -fPIC -else - FPIC = -endif - - include ../../../conf/Makefile.local include ../../Makefile.ocaml CONF = ../../../conf @@ -132,10 +124,10 @@ settings.cmo : ../cockpit/page_settings.cmi CC = gcc -GLIB_CFLAGS = -Wall `pkg-config glib-2.0 --cflags` $(FPIC) -GLIB_LDFLAGS = `pkg-config glib-2.0 --libs` -lglibivy -lpcre $(FPIC) -GTK_CFLAGS = -Wall `pkg-config gtk+-2.0 --cflags` $(FPIC) -GTK_LDFLAGS = `pkg-config gtk+-2.0 --libs` -lglibivy -lpcre $(FPIC) +GLIB_CFLAGS = -Wall `pkg-config glib-2.0 --cflags` -fPIC +GLIB_LDFLAGS = `pkg-config glib-2.0 --libs` -lglibivy -lpcre -fPIC +GTK_CFLAGS = -Wall `pkg-config gtk+-2.0 --cflags` -fPIC +GTK_LDFLAGS = `pkg-config gtk+-2.0 --libs` -lglibivy -lpcre -fPIC UNAME = $(shell uname -s) diff --git a/sw/lib/ocaml/Makefile b/sw/lib/ocaml/Makefile index 2a4b445a61..3159a90804 100644 --- a/sw/lib/ocaml/Makefile +++ b/sw/lib/ocaml/Makefile @@ -36,13 +36,6 @@ OCAMLLIBDIR=$(shell $(OCAMLC) -where) #VERBOSITY = -verbose VERBOSITY = -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -ccopt -fPIC -else - FPIC = -endif - UNAME = $(shell uname -s) ifeq ("$(UNAME)","Darwin") MKTEMP = gmktemp @@ -112,7 +105,7 @@ tests : lib-pprz.cma $(TESTS_CMO) %.o : %.c @echo OC $< - $(Q)$(OCAMLC) $(FPIC) $(INCLUDES) -package $(PKGCOMMON) -c $< + $(Q)$(OCAMLC) -ccopt -fPIC $(INCLUDES) -package $(PKGCOMMON) -c $< $(XCMO) $(XCMX) myGtkInit.cmo : PKGCOMMON=$(XPKGCOMMON) diff --git a/sw/simulator/Makefile b/sw/simulator/Makefile index b6010058e8..dc1f876449 100644 --- a/sw/simulator/Makefile +++ b/sw/simulator/Makefile @@ -22,12 +22,6 @@ # Quiet compilation Q=@ -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -fPIC -else - FPIC = -endif include ../../conf/Makefile.local include ../Makefile.ocaml @@ -88,7 +82,7 @@ diffusion : stdlib.cmo diffusion.cmo %.o : %.c @echo CC $< - $(Q)$(CC) $(FPIC) -c $< $(CAML_CFLAGS) + $(Q)$(CC) -fPIC -c $< $(CAML_CFLAGS) %.cmx : %.ml @echo OOC $<