[Makefile] use -fPIC for all architectures

This commit is contained in:
Felix Ruess
2013-04-22 01:34:32 +02:00
parent 09c97dd6c4
commit cf5a44a81b
7 changed files with 11 additions and 61 deletions
+1 -8
View File
@@ -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
+2 -10
View File
@@ -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
+1 -8
View File
@@ -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
+1 -8
View File
@@ -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
+4 -12
View File
@@ -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)
+1 -8
View File
@@ -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)
+1 -7
View File
@@ -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 $<