diff mbox

Makefile cleanup

Message ID 1397047998-30461-1-git-send-email-petri.savolainen@linaro.org
State Accepted
Headers show

Commit Message

Petri Savolainen April 9, 2014, 12:53 p.m. UTC
GCC option-fPIC decreases performance with static libraries and
should be enable only when really needed.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 platform/linux-generic/Makefile | 8 ++++----
 test/api_test/Makefile          | 8 ++++----
 test/example/Makefile           | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

Comments

Maxim Uvarov April 10, 2014, 9:45 a.m. UTC | #1
will a little bit hold this patch due to test/libpcap will not build now 
by default (i.e. with just make command).

Maxim.

On 04/09/2014 04:53 PM, Petri Savolainen wrote:
> GCC option-fPIC decreases performance with static libraries and
> should be enable only when really needed.
>
> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
> ---
>   platform/linux-generic/Makefile | 8 ++++----
>   test/api_test/Makefile          | 8 ++++----
>   test/example/Makefile           | 2 +-
>   3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile
> index 15e2a2c..ec5d4a7 100644
> --- a/platform/linux-generic/Makefile
> +++ b/platform/linux-generic/Makefile
> @@ -35,7 +35,10 @@ DOC_DIR  = ./doc
>   EXTRA_CFLAGS  += -I$(ODP_ROOT)/include
>   EXTRA_CFLAGS  += -I./include
>   EXTRA_CFLAGS  += -I./include/api
> -EXTRA_CFLAGS  += -fPIC
> +
> +# Option for shared libraries.
> +# Decreases performance with static libraries.
> +# EXTRA_CFLAGS  += -fPIC
>   
>   ifeq ($(ODP_HAVE_NETMAP),yes)
>   EXTRA_CFLAGS  += -DODP_HAVE_NETMAP
> @@ -80,9 +83,6 @@ all: libs docs
>   
>   -include $(DEPS)
>   
> -#$(OBJ_DIR):
> -#	$(MKDIR) $(OBJ_DIR)
> -
>   $(LIB_DIR):
>   	$(MKDIR) $(LIB_DIR)
>   
> diff --git a/test/api_test/Makefile b/test/api_test/Makefile
> index 0398cd2..3311177 100644
> --- a/test/api_test/Makefile
> +++ b/test/api_test/Makefile
> @@ -59,19 +59,19 @@ $(OBJ_DIR)/%.o: %.c
>   # Link rule
>   #
>   $(ODP_ATOMIC): $(ODP_LIB) $(ATOMIC_OBJS)
> -	$(ECHO) Linking $<
> +	$(ECHO) Linking $@
>   	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
>   
>   $(ODP_SHM): $(ODP_LIB) $(SHM_OBJS)
> -	$(ECHO) Linking $<
> +	$(ECHO) Linking $@
>   	$(CC) $(LDFLAGS) $(SHM_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
>   
>   $(ODP_RING): $(ODP_LIB) $(RING_OBJS)
> -	$(ECHO) Linking $<
> +	$(ECHO) Linking $@
>   	$(CC) $(LDFLAGS) $(RING_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
>   
>   $(ODP_TIM): $(ODP_LIB) $(TIM_OBJS)
> -	$(ECHO) Linking $<
> +	$(ECHO) Linking $@
>   	$(CC) $(LDFLAGS) $(TIM_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
>   
>   .PHONY: clean
> diff --git a/test/example/Makefile b/test/example/Makefile
> index 2dc148a..6b104ba 100644
> --- a/test/example/Makefile
> +++ b/test/example/Makefile
> @@ -31,7 +31,7 @@ $(OBJ_DIR)/%.o: %.c
>   # Link rule
>   #
>   $(ODP_APP): $(ODP_LIB) $(OBJS)
> -	$(ECHO) Linking $<
> +	$(ECHO) Linking $@
>   	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
>   
>   .PHONY: clean
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile
index 15e2a2c..ec5d4a7 100644
--- a/platform/linux-generic/Makefile
+++ b/platform/linux-generic/Makefile
@@ -35,7 +35,10 @@  DOC_DIR  = ./doc
 EXTRA_CFLAGS  += -I$(ODP_ROOT)/include
 EXTRA_CFLAGS  += -I./include
 EXTRA_CFLAGS  += -I./include/api
-EXTRA_CFLAGS  += -fPIC
+
+# Option for shared libraries.
+# Decreases performance with static libraries.
+# EXTRA_CFLAGS  += -fPIC
 
 ifeq ($(ODP_HAVE_NETMAP),yes)
 EXTRA_CFLAGS  += -DODP_HAVE_NETMAP
@@ -80,9 +83,6 @@  all: libs docs
 
 -include $(DEPS)
 
-#$(OBJ_DIR):
-#	$(MKDIR) $(OBJ_DIR)
-
 $(LIB_DIR):
 	$(MKDIR) $(LIB_DIR)
 
diff --git a/test/api_test/Makefile b/test/api_test/Makefile
index 0398cd2..3311177 100644
--- a/test/api_test/Makefile
+++ b/test/api_test/Makefile
@@ -59,19 +59,19 @@  $(OBJ_DIR)/%.o: %.c
 # Link rule
 #
 $(ODP_ATOMIC): $(ODP_LIB) $(ATOMIC_OBJS)
-	$(ECHO) Linking $<
+	$(ECHO) Linking $@
 	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 $(ODP_SHM): $(ODP_LIB) $(SHM_OBJS)
-	$(ECHO) Linking $<
+	$(ECHO) Linking $@
 	$(CC) $(LDFLAGS) $(SHM_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 $(ODP_RING): $(ODP_LIB) $(RING_OBJS)
-	$(ECHO) Linking $<
+	$(ECHO) Linking $@
 	$(CC) $(LDFLAGS) $(RING_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 $(ODP_TIM): $(ODP_LIB) $(TIM_OBJS)
-	$(ECHO) Linking $<
+	$(ECHO) Linking $@
 	$(CC) $(LDFLAGS) $(TIM_OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 .PHONY: clean
diff --git a/test/example/Makefile b/test/example/Makefile
index 2dc148a..6b104ba 100644
--- a/test/example/Makefile
+++ b/test/example/Makefile
@@ -31,7 +31,7 @@  $(OBJ_DIR)/%.o: %.c
 # Link rule
 #
 $(ODP_APP): $(ODP_LIB) $(OBJS)
-	$(ECHO) Linking $<
+	$(ECHO) Linking $@
 	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) $(STD_LIBS) -o $@
 
 .PHONY: clean