diff mbox

Makefile cleanup

Message ID 1392732491-2051-1-git-send-email-petri.savolainen@linaro.org
State Accepted, archived
Headers show

Commit Message

Petri Savolainen Feb. 18, 2014, 2:08 p.m. UTC
- Enabled test level make / make clean without install
- Main level Makefile installs files still by default
- Moved common stuff into odp/Makefile.inc and odp/test/Makefile.inc

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 Makefile                        | 15 +++++++--------
 Makefile.inc                    | 34 +++++++++++++++++++++-------------
 platform/linux-generic/Makefile |  4 ++--
 test/Makefile.inc               | 19 +++++++++++++++----
 test/api_test/Makefile          | 34 ++++++++++++++++++----------------
 test/example/Makefile           | 21 ++++++++++-----------
 test/packet/Makefile            | 22 ++++++++--------------
 test/packet_netmap/Makefile     | 20 +++++++-------------
 8 files changed, 88 insertions(+), 81 deletions(-)

Comments

Mike Holmes Feb. 18, 2014, 2:16 p.m. UTC | #1
We need to drop the use of CFLAGS in defining the default flags and use
EXTRA_FLAGS to comply with the GNU MAKE guidelines.



On 18 February 2014 09:08, Petri Savolainen <petri.savolainen@linaro.org>wrote:

> - Enabled test level make / make clean without install
> - Main level Makefile installs files still by default
> - Moved common stuff into odp/Makefile.inc and odp/test/Makefile.inc
>
> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
> ---
>  Makefile                        | 15 +++++++--------
>  Makefile.inc                    | 34 +++++++++++++++++++++-------------
>  platform/linux-generic/Makefile |  4 ++--
>  test/Makefile.inc               | 19 +++++++++++++++----
>  test/api_test/Makefile          | 34 ++++++++++++++++++----------------
>  test/example/Makefile           | 21 ++++++++++-----------
>  test/packet/Makefile            | 22 ++++++++--------------
>  test/packet_netmap/Makefile     | 20 +++++++-------------
>  8 files changed, 88 insertions(+), 81 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f086750..2512343 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -5,10 +5,9 @@
>
>  .DEFAULT_GOAL := default
>
> -ODP_ROOT      = $(PWD)
> -ODP_TESTS     = $(ODP_ROOT)/test
> -PLATFORM_ROOT = $(ODP_ROOT)/platform/$(PLATFORM)
> -INCLUDE       = -I$(ODP_ROOT)/include
> +ODP_ROOT        = $(PWD)
> +ODP_TESTS       = $(ODP_ROOT)/test
> +export DESTDIR  = $(ODP_ROOT)/build
>
>  include $(ODP_ROOT)/Makefile.inc
>
> @@ -28,19 +27,19 @@ tests: libs_install
>
>  .PHONY: docs
>  docs:
> -       $(MAKE) -C $(PLATFORM_ROOT) docs
> +       $(MAKE) -C $(ODP_DIR) docs
>
>  .PHONY: docs_install
>  docs_install: docs
> -       $(MAKE) -C $(PLATFORM_ROOT) docs_install
> +       $(MAKE) -C $(ODP_DIR) docs_install
>
>  .PHONY: lib
>  lib:
> -       $(MAKE) -C $(PLATFORM_ROOT) libs
> +       $(MAKE) -C $(ODP_DIR) libs
>
>  .PHONY: clean
>  clean:
> -       $(MAKE) -C $(PLATFORM_ROOT) clean
> +       $(MAKE) -C $(ODP_DIR) clean
>         $(MAKE) -C $(ODP_TESTS) clean
>
>  .PHONY: libs_install
> diff --git a/Makefile.inc b/Makefile.inc
> index 523385d..1af7643 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -4,27 +4,35 @@
>  # SPDX-License-Identifier:     BSD-3-Clause
>
>  PLATFORM ?= linux-generic
> -CFLAGS  += -DODP_DEBUG=1
> -CFLAGS  += -O3
> -#CFLAGS  += -O0 -g
> +OBJ_DIR   = ./obj
> +ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
>
> -OBJ_DIR  = ./obj
> -DESTDIR ?= $(ODP_ROOT)/build
> -
> -CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -CFLAGS += -Wformat-security -Wundef -Wwrite-strings
>
>  CC     ?= gcc
>  LD     ?= gcc
>  AR     ?= ar
> -
> -ECHO   := echo
> +ECHO   := @echo
>  MKDIR  := mkdir -p
>  RMDIR  := rm -rf
>  RM     := rm -f
>  COPY   := cp -r
>
> -CFLAGS  += -pthread
> +CFLAGS += -DODP_DEBUG=1
> +CFLAGS += -O3
> +#CFLAGS += -O0 -g
> +CFLAGS += -pthread
> +CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> +CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> +CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> +CFLAGS += -Wformat-security -Wundef -Wwrite-strings
> +
> +
>  LDFLAGS += -pthread
> +LDFLAGS += -lrt
> +LDFLAGS += $(EXTRA_CFLAGS)
> +
> +.PHONY: default
> +default:
> +
> +$(OBJ_DIR):
> +       $(MKDIR) $(OBJ_DIR)
> diff --git a/platform/linux-generic/Makefile
> b/platform/linux-generic/Makefile
> index b640928..676d4bf 100644
> --- a/platform/linux-generic/Makefile
> +++ b/platform/linux-generic/Makefile
> @@ -78,8 +78,8 @@ all: libs docs
>
>  -include $(DEPS)
>
> -$(OBJ_DIR):
> -       $(MKDIR) $(OBJ_DIR)
> +#$(OBJ_DIR):
> +#      $(MKDIR) $(OBJ_DIR)
>
>  $(LIB_DIR):
>         $(MKDIR) $(LIB_DIR)
> diff --git a/test/Makefile.inc b/test/Makefile.inc
> index 72bbebd..1bb6a3c 100644
> --- a/test/Makefile.inc
> +++ b/test/Makefile.inc
> @@ -3,10 +3,21 @@
>  #
>  # SPDX-License-Identifier:     BSD-3-Clause
>
> -ODP_TEST_ROOT = $(ODP_ROOT)/test
>
> +ifdef DESTDIR
> +
> +ODP_LIB = $(DESTDIR)/lib/libodp.a
>  CFLAGS += -I$(DESTDIR)/include
> -LIB = -L$(DESTDIR)/lib -lodp
> +CFLAGS += -I$(DESTDIR)/include/api
> +
> +else
> +
> +ODP_LIB = $(ODP_DIR)/lib/libodp.a
> +CFLAGS += -I$(ODP_ROOT)/include
> +CFLAGS += -I$(ODP_DIR)/include/api
> +
> +$(ODP_LIB):
> +       @echo Building $@
> +       $(MAKE) -C $(ODP_DIR) libs
>
> -LDFLAGS += -lrt
> -LDFLAGS += $(EXTRA_CFLAGS)
> +endif
> diff --git a/test/api_test/Makefile b/test/api_test/Makefile
> index 15c18f4..1c90174 100644
> --- a/test/api_test/Makefile
> +++ b/test/api_test/Makefile
> @@ -12,12 +12,19 @@ ODP_ATOMIC    = odp_atomic
>  ODP_SHM       = odp_shm
>  ODP_RING      = odp_ring
>
> -CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
> -
> -include ../Makefile.inc
>  include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
> +
> +.PHONY: default
> +default: all
> +
> +CFLAGS  += -I.
> +#CFLAGS  += -I$(ODP_LIB)
> +#CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
> +#CFLAGS  += -I$(ARCH_INC)
> +#CFLAGS  += -DODP_TEST_ATOMIC
> +
>
> -CFLAGS      += -I$(ODP_TEST_ROOT)/api_test
>
>  ATOMIC_OBJS  =
>  ATOMIC_OBJS += $(OBJ_DIR)/odp_common.o
> @@ -41,12 +48,6 @@ ring: $(OBJ_DIR) $(ODP_RING)
>
>  -include $(DEPS)
>
> -$(DESTDIR)/lib/libodp.a:
> -       @test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -       $(MKDIR) $(OBJ_DIR)
> -
>  #
>  # Compile rules
>  #
> @@ -57,17 +58,17 @@ $(OBJ_DIR)/%.o: %.c
>  #
>  # Link rule
>  #
> -$(ODP_ATOMIC): $(ATOMIC_OBJS)
> +$(ODP_ATOMIC): $(ODP_LIB) $(ATOMIC_OBJS)
>         $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(LIB) -o $@
> +       $(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(ODP_LIB) -o $@
>
> -$(ODP_SHM): $(SHM_OBJS)
> +$(ODP_SHM): $(ODP_LIB) $(SHM_OBJS)
>         $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(SHM_OBJS) $(LIB) -o $@
> +       $(CC) $(LDFLAGS) $(SHM_OBJS) $(ODP_LIB) -o $@
>
> -$(ODP_RING): $(RING_OBJS)
> +$(ODP_RING): $(ODP_LIB) $(RING_OBJS)
>         $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(RING_OBJS) $(LIB) -o $@
> +       $(CC) $(LDFLAGS) $(RING_OBJS) $(ODP_LIB) -o $@
>
>  .PHONY: clean
>  clean:
> @@ -75,6 +76,7 @@ clean:
>         $(RM) $(ODP_ATOMIC)
>         $(RM) $(ODP_SHM)
>         $(RM) $(ODP_RING)
> +       $(MAKE) -C $(ODP_DIR) clean
>
>  .PHONY: install
>  install:
> diff --git a/test/example/Makefile b/test/example/Makefile
> index d43e780..ba3940f 100644
> --- a/test/example/Makefile
> +++ b/test/example/Makefile
> @@ -6,24 +6,22 @@
>  ODP_ROOT = ../..
>  ODP_APP  = odp_example
>
> -include ../Makefile.inc
>  include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
> +
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
> +
> +
> +CFLAGS  += -I.
>
>  OBJS     =
>  OBJS    += $(OBJ_DIR)/odp_example.o
>
>  DEPS     = $(OBJS:.o=.d)
>
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> -
>  -include $(DEPS)
>
> -$(DESTDIR)/lib/libodp.a:
> -       @test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -       $(MKDIR) $(OBJ_DIR)
>
>  #
>  # Compile rules
> @@ -35,14 +33,15 @@ $(OBJ_DIR)/%.o: %.c
>  #
>  # Link rule
>  #
> -$(ODP_APP): $(OBJS)
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
>         $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +       $(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>
>  .PHONY: clean
>  clean:
>         $(RMDIR) $(OBJ_DIR)
>         $(RM) $(ODP_APP)
> +       $(MAKE) -C $(ODP_DIR) clean
>
>  .PHONY: install
>  install:
> diff --git a/test/packet/Makefile b/test/packet/Makefile
> index f1cb7d9..83c813b 100644
> --- a/test/packet/Makefile
> +++ b/test/packet/Makefile
> @@ -6,27 +6,21 @@
>  ODP_ROOT = ../..
>  ODP_APP  = odp_packet
>
> -include ../Makefile.inc
> -include $(ODP_ROOT)/Makefile.inc
> +CFLAGS  += -I.
>
> -CFLAGS  += -I$(ODP_TEST_ROOT)/packet
> +include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
>
>  OBJS     =
>  OBJS    += $(OBJ_DIR)/odp_example_pktio.o
>
>  DEPS     = $(OBJS:.o=.d)
>
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
>
>  -include $(DEPS)
>
> -$(DESTDIR)/lib/libodp.a:
> -       @test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -       $(MKDIR) $(OBJ_DIR)
> -
>  #
>  # Compile rules
>  #
> @@ -37,14 +31,14 @@ $(OBJ_DIR)/%.o: %.c
>  #
>  # Link rule
>  #
> -$(ODP_APP): $(OBJS)
> -       $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
> +       $(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>
>  .PHONY: clean
>  clean:
>         $(RMDIR) $(OBJ_DIR)
>         $(RM) $(ODP_APP)
> +       $(MAKE) -C $(ODP_DIR) clean
>
>  .PHONY: install
>  install:
> diff --git a/test/packet_netmap/Makefile b/test/packet_netmap/Makefile
> index 5febb33..1ef0df1 100644
> --- a/test/packet_netmap/Makefile
> +++ b/test/packet_netmap/Makefile
> @@ -6,28 +6,22 @@
>  ODP_ROOT = ../..
>  ODP_APP  = odp_packet
>
> +CFLAGS  += -I.
>  CFLAGS  += -DODP_HAVE_NETMAP
> -CFLAGS  += -O0 -g
>
> -include ../Makefile.inc
>  include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
>
>  OBJS     =
>  OBJS    += $(OBJ_DIR)/odp_example_pktio_netmap.o
>
>  DEPS     = $(OBJS:.o=.d)
>
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
>
>  -include $(DEPS)
>
> -$(DESTDIR)/lib/libodp.a:
> -       @test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -       $(MKDIR) $(OBJ_DIR)
> -
>  #
>  # Compile rules
>  #
> @@ -38,14 +32,14 @@ $(OBJ_DIR)/%.o: %.c
>  #
>  # Link rule
>  #
> -$(ODP_APP): $(OBJS)
> -       $(ECHO) Linking $<
> -       $(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
> +       $(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>
>  .PHONY: clean
>  clean:
>         $(RMDIR) $(OBJ_DIR)
>         $(RM) $(ODP_APP)
> +       $(MAKE) -C $(ODP_DIR) clean
>
>  .PHONY: install
>  install:
> --
> 1.8.5.3
>
> --
> You received this message because you are subscribed to the Google Groups
> "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/1392732491-2051-1-git-send-email-petri.savolainen%40linaro.org
> .
> For more options, visit
> https://groups.google.com/a/linaro.org/groups/opt_out.
>
Petri Savolainen Feb. 18, 2014, 2:20 p.m. UTC | #2
Hi,

I think you were going to do that. Shouldn't be a problem to merge those 
changes with this one.

-Petri


On Tuesday, 18 February 2014 16:16:02 UTC+2, Mike Holmes wrote:

> We need to drop the use of CFLAGS in defining the default flags and use 
> EXTRA_FLAGS to comply with the GNU MAKE guidelines. 
>  
>
>
>
>
Petri Savolainen Feb. 24, 2014, 10:23 a.m. UTC | #3
Hi Maxim,

Why this has not been merged yet?

-Petri
Maxim Uvarov Feb. 24, 2014, 10:41 a.m. UTC | #4
On 02/24/2014 02:23 PM, Petri Savolainen wrote:
> Hi Maxim,
>
> Why this has not been merged yet?
>
> -Petri
Hello Petri,

Because of Makefile patches were topic for discussion on odp call and 
your patch did not pass review process. Mike did new version based on 
your patch. His version now is in the tree. Patch from current email 
dropped.

Thanks,
Maxim.

> -- 
> You received this message because you are subscribed to the Google 
> Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit 
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org.
> For more options, visit 
> https://groups.google.com/a/linaro.org/groups/opt_out.
Anders Roxell Feb. 24, 2014, 10:57 a.m. UTC | #5
On 2014-02-24 14:41, Maxim Uvarov wrote:
> On 02/24/2014 02:23 PM, Petri Savolainen wrote:
> >Hi Maxim,
> >
> >Why this has not been merged yet?
> >
> >-Petri
> Hello Petri,
> 
> Because of Makefile patches were topic for discussion on odp call
> and your patch did not pass review process. Mike did new version
> based on your patch. His version now is in the tree. Patch from
> current email dropped.

I'm confused...
I thought that this patch was okay to merge and Mikes patch was _not_
okay to merge.

Cheers,
Anders
> 
> Thanks,
> Maxim.
> 
> >-- 
> >You received this message because you are subscribed to the Google
> >Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> >To unsubscribe from this group and stop receiving emails from it,
> >send an email to lng-odp+unsubscribe@linaro.org.
> >To post to this group, send email to lng-odp@linaro.org.
> >Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> >To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org.
> >For more options, visit
> >https://groups.google.com/a/linaro.org/groups/opt_out.
> 
> -- 
> You received this message because you are subscribed to the Google Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org.
> For more options, visit https://groups.google.com/a/linaro.org/groups/opt_out.
Maxim Uvarov Feb. 24, 2014, 11:01 a.m. UTC | #6
On 02/24/2014 02:57 PM, Anders Roxell wrote:
> On 2014-02-24 14:41, Maxim Uvarov wrote:
>> On 02/24/2014 02:23 PM, Petri Savolainen wrote:
>>> Hi Maxim,
>>>
>>> Why this has not been merged yet?
>>>
>>> -Petri
>> Hello Petri,
>>
>> Because of Makefile patches were topic for discussion on odp call
>> and your patch did not pass review process. Mike did new version
>> based on your patch. His version now is in the tree. Patch from
>> current email dropped.
> I'm confused...
> I thought that this patch was okay to merge and Mikes patch was _not_
> okay to merge.
>
> Cheers,
> Anders
Mike's patches fixed CFLAGS while Pertis did only clean up. We need 
Mike's patch
to make clang work again.

Maxim.

>> Thanks,
>> Maxim.
>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to lng-odp+unsubscribe@linaro.org.
>>> To post to this group, send email to lng-odp@linaro.org.
>>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
>>> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org.
>>> For more options, visit
>>> https://groups.google.com/a/linaro.org/groups/opt_out.
>> -- 
>> You received this message because you are subscribed to the Google Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to lng-odp+unsubscribe@linaro.org.
>> To post to this group, send email to lng-odp@linaro.org.
>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
>> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org.
>> For more options, visit https://groups.google.com/a/linaro.org/groups/opt_out.
Anders Roxell Feb. 24, 2014, 11:07 a.m. UTC | #7
On 2014-02-24 15:01, Maxim Uvarov wrote:
> On 02/24/2014 02:57 PM, Anders Roxell wrote:
> >On 2014-02-24 14:41, Maxim Uvarov wrote:
> >>On 02/24/2014 02:23 PM, Petri Savolainen wrote:
> >>>Hi Maxim,
> >>>
> >>>Why this has not been merged yet?
> >>>
> >>>-Petri
> >>Hello Petri,
> >>
> >>Because of Makefile patches were topic for discussion on odp call
> >>and your patch did not pass review process. Mike did new version
> >>based on your patch. His version now is in the tree. Patch from
> >>current email dropped.
> >I'm confused...
> >I thought that this patch was okay to merge and Mikes patch was _not_
> >okay to merge.
> >
> >Cheers,
> >Anders
> Mike's patches fixed CFLAGS while Pertis did only clean up. We need
> Mike's patch
> to make clang work again.

Confused again...
Petri's patch has been on the list for more than 24 hours without any
objections to the cleanup as such...

Mike's patch has been on the list for some time as well... However, with
comments right?
And to the best of my knowledge he didn't send a new patch, you applied
the patch that had comments...

Anders

> 
> Maxim.
> 
> >>Thanks,
> >>Maxim.
> >>
> >>>-- 
> >>>You received this message because you are subscribed to the Google
> >>>Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> >>>To unsubscribe from this group and stop receiving emails from it,
> >>>send an email to lng-odp+unsubscribe@linaro.org.
> >>>To post to this group, send email to lng-odp@linaro.org.
> >>>Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> >>>To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org.
> >>>For more options, visit
> >>>https://groups.google.com/a/linaro.org/groups/opt_out.
> >>-- 
> >>You received this message because you are subscribed to the Google Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> >>To unsubscribe from this group and stop receiving emails from it, send an email to lng-odp+unsubscribe@linaro.org.
> >>To post to this group, send email to lng-odp@linaro.org.
> >>Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> >>To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org.
> >>For more options, visit https://groups.google.com/a/linaro.org/groups/opt_out.
>
Petri Savolainen Feb. 24, 2014, 11:21 a.m. UTC | #8
Hi,

My and Mike's patches fix different things. I did not touch the CFLAGS 
because I knew Mike was going to do that. Please check again what's in 
there. Also, as Anders said, there was no objections.

-Petri



On Monday, 24 February 2014 13:07:01 UTC+2, Anders Roxell wrote:
>
> On 2014-02-24 15:01, Maxim Uvarov wrote: 
> > On 02/24/2014 02:57 PM, Anders Roxell wrote: 
> > >On 2014-02-24 14:41, Maxim Uvarov wrote: 
> > >>On 02/24/2014 02:23 PM, Petri Savolainen wrote: 
> > >>>Hi Maxim, 
> > >>> 
> > >>>Why this has not been merged yet? 
> > >>> 
> > >>>-Petri 
> > >>Hello Petri, 
> > >> 
> > >>Because of Makefile patches were topic for discussion on odp call 
> > >>and your patch did not pass review process. Mike did new version 
> > >>based on your patch. His version now is in the tree. Patch from 
> > >>current email dropped. 
> > >I'm confused... 
> > >I thought that this patch was okay to merge and Mikes patch was _not_ 
> > >okay to merge. 
> > > 
> > >Cheers, 
> > >Anders 
> > Mike's patches fixed CFLAGS while Pertis did only clean up. We need 
> > Mike's patch 
> > to make clang work again. 
>
> Confused again... 
> Petri's patch has been on the list for more than 24 hours without any 
> objections to the cleanup as such... 
>
> Mike's patch has been on the list for some time as well... However, with 
> comments right? 
> And to the best of my knowledge he didn't send a new patch, you applied 
> the patch that had comments... 
>
> Anders 
>
> > 
> > Maxim. 
> > 
> > >>Thanks, 
> > >>Maxim. 
> > >> 
> > >>>-- 
> > >>>You received this message because you are subscribed to the Google 
> > >>>Groups "LNG ODP Sub-team - lng...@linaro.org <javascript:>" group. 
> > >>>To unsubscribe from this group and stop receiving emails from it, 
> > >>>send an email to lng-odp+u...@linaro.org <javascript:>. 
> > >>>To post to this group, send email to lng...@linaro.org <javascript:>. 
>
> > >>>Visit this group at 
> http://groups.google.com/a/linaro.org/group/lng-odp/. 
> > >>>To view this discussion on the web visit 
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org. 
>
> > >>>For more options, visit 
> > >>>https://groups.google.com/a/linaro.org/groups/opt_out. 
> > >>-- 
> > >>You received this message because you are subscribed to the Google 
> Groups "LNG ODP Sub-team - lng...@linaro.org <javascript:>" group. 
> > >>To unsubscribe from this group and stop receiving emails from it, send 
> an email to lng-odp+u...@linaro.org <javascript:>. 
> > >>To post to this group, send email to lng...@linaro.org <javascript:>. 
> > >>Visit this group at 
> http://groups.google.com/a/linaro.org/group/lng-odp/. 
> > >>To view this discussion on the web visit 
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org. 
>
> > >>For more options, visit 
> https://groups.google.com/a/linaro.org/groups/opt_out. 
> > 
>
> -- 
> Anders Roxell 
> anders...@linaro.org <javascript:> 
> M: +46 709 71 42 85 | IRC: roxell 
>
Anders Roxell Feb. 24, 2014, 11:29 a.m. UTC | #9
On 2014-02-24 03:21, Petri Savolainen wrote:
> Hi,
> 
> My and Mike's patches fix different things. I did not touch the CFLAGS 
> because I knew Mike was going to do that. Please check again what's in 
> there. Also, as Anders said, there was no objections.

However, now I'm guessing you have to resend your patch after rebase it
against origin/master...

Cheers,
Anders

> 
> -Petri
> 
> 
> 
> On Monday, 24 February 2014 13:07:01 UTC+2, Anders Roxell wrote:
> >
> > On 2014-02-24 15:01, Maxim Uvarov wrote: 
> > > On 02/24/2014 02:57 PM, Anders Roxell wrote: 
> > > >On 2014-02-24 14:41, Maxim Uvarov wrote: 
> > > >>On 02/24/2014 02:23 PM, Petri Savolainen wrote: 
> > > >>>Hi Maxim, 
> > > >>> 
> > > >>>Why this has not been merged yet? 
> > > >>> 
> > > >>>-Petri 
> > > >>Hello Petri, 
> > > >> 
> > > >>Because of Makefile patches were topic for discussion on odp call 
> > > >>and your patch did not pass review process. Mike did new version 
> > > >>based on your patch. His version now is in the tree. Patch from 
> > > >>current email dropped. 
> > > >I'm confused... 
> > > >I thought that this patch was okay to merge and Mikes patch was _not_ 
> > > >okay to merge. 
> > > > 
> > > >Cheers, 
> > > >Anders 
> > > Mike's patches fixed CFLAGS while Pertis did only clean up. We need 
> > > Mike's patch 
> > > to make clang work again. 
> >
> > Confused again... 
> > Petri's patch has been on the list for more than 24 hours without any 
> > objections to the cleanup as such... 
> >
> > Mike's patch has been on the list for some time as well... However, with 
> > comments right? 
> > And to the best of my knowledge he didn't send a new patch, you applied 
> > the patch that had comments... 
> >
> > Anders 
> >
> > > 
> > > Maxim. 
> > > 
> > > >>Thanks, 
> > > >>Maxim. 
> > > >> 
> > > >>>-- 
> > > >>>You received this message because you are subscribed to the Google 
> > > >>>Groups "LNG ODP Sub-team - lng...@linaro.org <javascript:>" group. 
> > > >>>To unsubscribe from this group and stop receiving emails from it, 
> > > >>>send an email to lng-odp+u...@linaro.org <javascript:>. 
> > > >>>To post to this group, send email to lng...@linaro.org <javascript:>. 
> >
> > > >>>Visit this group at 
> > http://groups.google.com/a/linaro.org/group/lng-odp/. 
> > > >>>To view this discussion on the web visit 
> > https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org. 
> >
> > > >>>For more options, visit 
> > > >>>https://groups.google.com/a/linaro.org/groups/opt_out. 
> > > >>-- 
> > > >>You received this message because you are subscribed to the Google 
> > Groups "LNG ODP Sub-team - lng...@linaro.org <javascript:>" group. 
> > > >>To unsubscribe from this group and stop receiving emails from it, send 
> > an email to lng-odp+u...@linaro.org <javascript:>. 
> > > >>To post to this group, send email to lng...@linaro.org <javascript:>. 
> > > >>Visit this group at 
> > http://groups.google.com/a/linaro.org/group/lng-odp/. 
> > > >>To view this discussion on the web visit 
> > https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org. 
> >
> > > >>For more options, visit 
> > https://groups.google.com/a/linaro.org/groups/opt_out. 
> > > 
> >
> > -- 
> > Anders Roxell 
> > anders...@linaro.org <javascript:> 
> > M: +46 709 71 42 85 | IRC: roxell 
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ce716655-53f0-4b11-afeb-b726fd7d1e93%40linaro.org.
> For more options, visit https://groups.google.com/a/linaro.org/groups/opt_out.
Maxim Uvarov Feb. 24, 2014, 11:35 a.m. UTC | #10
On 02/24/2014 03:07 PM, Anders Roxell wrote:
> On 2014-02-24 15:01, Maxim Uvarov wrote:
>> On 02/24/2014 02:57 PM, Anders Roxell wrote:
>>> On 2014-02-24 14:41, Maxim Uvarov wrote:
>>>> On 02/24/2014 02:23 PM, Petri Savolainen wrote:
>>>>> Hi Maxim,
>>>>>
>>>>> Why this has not been merged yet?
>>>>>
>>>>> -Petri
>>>> Hello Petri,
>>>>
>>>> Because of Makefile patches were topic for discussion on odp call
>>>> and your patch did not pass review process. Mike did new version
>>>> based on your patch. His version now is in the tree. Patch from
>>>> current email dropped.
>>> I'm confused...
>>> I thought that this patch was okay to merge and Mikes patch was _not_
>>> okay to merge.
>>>
>>> Cheers,
>>> Anders
>> Mike's patches fixed CFLAGS while Pertis did only clean up. We need
>> Mike's patch
>> to make clang work again.
> Confused again...
> Petri's patch has been on the list for more than 24 hours without any
> objections to the cleanup as such...
>
> Mike's patch has been on the list for some time as well... However, with
> comments right?
> And to the best of my knowledge he didn't send a new patch, you applied
> the patch that had comments...
>
> Anders
he sent 2 clean up patches to the same thread.

Maxim.
>
>> Maxim.
>>
>>>> Thanks,
>>>> Maxim.
>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>> send an email to lng-odp+unsubscribe@linaro.org.
>>>>> To post to this group, send email to lng-odp@linaro.org.
>>>>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
>>>>> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-91292d474e1a%40linaro.org.
>>>>> For more options, visit
>>>>> https://groups.google.com/a/linaro.org/groups/opt_out.
>>>> -- 
>>>> You received this message because you are subscribed to the Google Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an email to lng-odp+unsubscribe@linaro.org.
>>>> To post to this group, send email to lng-odp@linaro.org.
>>>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
>>>> To view this discussion on the web visit https://groups.google.com/a/linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org.
>>>> For more options, visit https://groups.google.com/a/linaro.org/groups/opt_out.
Anders Roxell Feb. 24, 2014, 1:09 p.m. UTC | #11
On 24 February 2014 12:35, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 02/24/2014 03:07 PM, Anders Roxell wrote:
>
>> On 2014-02-24 15:01, Maxim Uvarov wrote:
>>
>>> On 02/24/2014 02:57 PM, Anders Roxell wrote:
>>>
>>>> On 2014-02-24 14:41, Maxim Uvarov wrote:
>>>>
>>>>> On 02/24/2014 02:23 PM, Petri Savolainen wrote:
>>>>>
>>>>>> Hi Maxim,
>>>>>>
>>>>>> Why this has not been merged yet?
>>>>>>
>>>>>> -Petri
>>>>>>
>>>>> Hello Petri,
>>>>>
>>>>> Because of Makefile patches were topic for discussion on odp call
>>>>> and your patch did not pass review process. Mike did new version
>>>>> based on your patch. His version now is in the tree. Patch from
>>>>> current email dropped.
>>>>>
>>>> I'm confused...
>>>> I thought that this patch was okay to merge and Mikes patch was _not_
>>>> okay to merge.
>>>>
>>>> Cheers,
>>>> Anders
>>>>
>>> Mike's patches fixed CFLAGS while Pertis did only clean up. We need
>>> Mike's patch
>>> to make clang work again.
>>>
>> Confused again...
>> Petri's patch has been on the list for more than 24 hours without any
>> objections to the cleanup as such...
>>
>> Mike's patch has been on the list for some time as well... However, with
>> comments right?
>> And to the best of my knowledge he didn't send a new patch, you applied
>> the patch that had comments...
>>
>> Anders
>>
> he sent 2 clean up patches to the same thread.


apparently not enough!


>
>
> Maxim.
>
>
>>  Maxim.
>>>
>>>  Thanks,
>>>>> Maxim.
>>>>>
>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to lng-odp+unsubscribe@linaro.org.
>>>>>> To post to this group, send email to lng-odp@linaro.org.
>>>>>> Visit this group at http://groups.google.com/a/
>>>>>> linaro.org/group/lng-odp/.
>>>>>> To view this discussion on the web visit https://groups.google.com/a/
>>>>>> linaro.org/d/msgid/lng-odp/ba4001dd-fc34-47ff-8b9a-
>>>>>> 91292d474e1a%40linaro.org.
>>>>>> For more options, visit
>>>>>> https://groups.google.com/a/linaro.org/groups/opt_out.
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "LNG ODP Sub-team - lng-odp@linaro.org" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to lng-odp+unsubscribe@linaro.org.
>>>>> To post to this group, send email to lng-odp@linaro.org.
>>>>> Visit this group at http://groups.google.com/a/
>>>>> linaro.org/group/lng-odp/.
>>>>> To view this discussion on the web visit https://groups.google.com/a/
>>>>> linaro.org/d/msgid/lng-odp/530B21D5.9030201%40linaro.org.
>>>>> For more options, visit https://groups.google.com/a/
>>>>> linaro.org/groups/opt_out.
>>>>>
>>>>
>
Maxim Uvarov Feb. 25, 2014, 6:51 a.m. UTC | #12
Applied patch. (with rebase to top of current tree).

Thanks,
Maxim.

On 02/18/2014 06:08 PM, Petri Savolainen wrote:
> - Enabled test level make / make clean without install
> - Main level Makefile installs files still by default
> - Moved common stuff into odp/Makefile.inc and odp/test/Makefile.inc
>
> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
> ---
>   Makefile                        | 15 +++++++--------
>   Makefile.inc                    | 34 +++++++++++++++++++++-------------
>   platform/linux-generic/Makefile |  4 ++--
>   test/Makefile.inc               | 19 +++++++++++++++----
>   test/api_test/Makefile          | 34 ++++++++++++++++++----------------
>   test/example/Makefile           | 21 ++++++++++-----------
>   test/packet/Makefile            | 22 ++++++++--------------
>   test/packet_netmap/Makefile     | 20 +++++++-------------
>   8 files changed, 88 insertions(+), 81 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index f086750..2512343 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -5,10 +5,9 @@
>   
>   .DEFAULT_GOAL := default
>   
> -ODP_ROOT      = $(PWD)
> -ODP_TESTS     = $(ODP_ROOT)/test
> -PLATFORM_ROOT = $(ODP_ROOT)/platform/$(PLATFORM)
> -INCLUDE       = -I$(ODP_ROOT)/include
> +ODP_ROOT        = $(PWD)
> +ODP_TESTS       = $(ODP_ROOT)/test
> +export DESTDIR  = $(ODP_ROOT)/build
>   
>   include $(ODP_ROOT)/Makefile.inc
>   
> @@ -28,19 +27,19 @@ tests: libs_install
>   
>   .PHONY: docs
>   docs:
> -	$(MAKE) -C $(PLATFORM_ROOT) docs
> +	$(MAKE) -C $(ODP_DIR) docs
>   
>   .PHONY: docs_install
>   docs_install: docs
> -	$(MAKE) -C $(PLATFORM_ROOT) docs_install
> +	$(MAKE) -C $(ODP_DIR) docs_install
>   
>   .PHONY: lib
>   lib:
> -	$(MAKE) -C $(PLATFORM_ROOT) libs
> +	$(MAKE) -C $(ODP_DIR) libs
>   
>   .PHONY: clean
>   clean:
> -	$(MAKE) -C $(PLATFORM_ROOT) clean
> +	$(MAKE) -C $(ODP_DIR) clean
>   	$(MAKE) -C $(ODP_TESTS) clean
>   
>   .PHONY: libs_install
> diff --git a/Makefile.inc b/Makefile.inc
> index 523385d..1af7643 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -4,27 +4,35 @@
>   # SPDX-License-Identifier:	BSD-3-Clause
>   
>   PLATFORM ?= linux-generic
> -CFLAGS  += -DODP_DEBUG=1
> -CFLAGS  += -O3
> -#CFLAGS  += -O0 -g
> +OBJ_DIR   = ./obj
> +ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
>   
> -OBJ_DIR  = ./obj
> -DESTDIR ?= $(ODP_ROOT)/build
> -
> -CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -CFLAGS += -Wformat-security -Wundef -Wwrite-strings
>   
>   CC     ?= gcc
>   LD     ?= gcc
>   AR     ?= ar
> -
> -ECHO   := echo
> +ECHO   := @echo
>   MKDIR  := mkdir -p
>   RMDIR  := rm -rf
>   RM     := rm -f
>   COPY   := cp -r
>   
> -CFLAGS  += -pthread
> +CFLAGS += -DODP_DEBUG=1
> +CFLAGS += -O3
> +#CFLAGS += -O0 -g
> +CFLAGS += -pthread
> +CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> +CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> +CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> +CFLAGS += -Wformat-security -Wundef -Wwrite-strings
> +
> +
>   LDFLAGS += -pthread
> +LDFLAGS += -lrt
> +LDFLAGS += $(EXTRA_CFLAGS)
> +
> +.PHONY: default
> +default:
> +
> +$(OBJ_DIR):
> +	$(MKDIR) $(OBJ_DIR)
> diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile
> index b640928..676d4bf 100644
> --- a/platform/linux-generic/Makefile
> +++ b/platform/linux-generic/Makefile
> @@ -78,8 +78,8 @@ all: libs docs
>   
>   -include $(DEPS)
>   
> -$(OBJ_DIR):
> -	$(MKDIR) $(OBJ_DIR)
> +#$(OBJ_DIR):
> +#	$(MKDIR) $(OBJ_DIR)
>   
>   $(LIB_DIR):
>   	$(MKDIR) $(LIB_DIR)
> diff --git a/test/Makefile.inc b/test/Makefile.inc
> index 72bbebd..1bb6a3c 100644
> --- a/test/Makefile.inc
> +++ b/test/Makefile.inc
> @@ -3,10 +3,21 @@
>   #
>   # SPDX-License-Identifier:	BSD-3-Clause
>   
> -ODP_TEST_ROOT = $(ODP_ROOT)/test
>   
> +ifdef DESTDIR
> +
> +ODP_LIB = $(DESTDIR)/lib/libodp.a
>   CFLAGS += -I$(DESTDIR)/include
> -LIB = -L$(DESTDIR)/lib -lodp
> +CFLAGS += -I$(DESTDIR)/include/api
> +
> +else
> +
> +ODP_LIB = $(ODP_DIR)/lib/libodp.a
> +CFLAGS += -I$(ODP_ROOT)/include
> +CFLAGS += -I$(ODP_DIR)/include/api
> +
> +$(ODP_LIB):
> +	@echo Building $@
> +	$(MAKE) -C $(ODP_DIR) libs
>   
> -LDFLAGS += -lrt
> -LDFLAGS += $(EXTRA_CFLAGS)
> +endif
> diff --git a/test/api_test/Makefile b/test/api_test/Makefile
> index 15c18f4..1c90174 100644
> --- a/test/api_test/Makefile
> +++ b/test/api_test/Makefile
> @@ -12,12 +12,19 @@ ODP_ATOMIC    = odp_atomic
>   ODP_SHM       = odp_shm
>   ODP_RING      = odp_ring
>   
> -CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
> -
> -include ../Makefile.inc
>   include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
> +
> +.PHONY: default
> +default: all
> +
> +CFLAGS  += -I.
> +#CFLAGS  += -I$(ODP_LIB)
> +#CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
> +#CFLAGS  += -I$(ARCH_INC)
> +#CFLAGS  += -DODP_TEST_ATOMIC
> +
>   
> -CFLAGS      += -I$(ODP_TEST_ROOT)/api_test
>   
>   ATOMIC_OBJS  =
>   ATOMIC_OBJS += $(OBJ_DIR)/odp_common.o
> @@ -41,12 +48,6 @@ ring: $(OBJ_DIR) $(ODP_RING)
>   
>   -include $(DEPS)
>   
> -$(DESTDIR)/lib/libodp.a:
> -	@test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -	$(MKDIR) $(OBJ_DIR)
> -
>   #
>   # Compile rules
>   #
> @@ -57,17 +58,17 @@ $(OBJ_DIR)/%.o: %.c
>   #
>   # Link rule
>   #
> -$(ODP_ATOMIC): $(ATOMIC_OBJS)
> +$(ODP_ATOMIC): $(ODP_LIB) $(ATOMIC_OBJS)
>   	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(LIB) -o $@
> +	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(ODP_LIB) -o $@
>   
> -$(ODP_SHM): $(SHM_OBJS)
> +$(ODP_SHM): $(ODP_LIB) $(SHM_OBJS)
>   	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(SHM_OBJS) $(LIB) -o $@
> +	$(CC) $(LDFLAGS) $(SHM_OBJS) $(ODP_LIB) -o $@
>   
> -$(ODP_RING): $(RING_OBJS)
> +$(ODP_RING): $(ODP_LIB) $(RING_OBJS)
>   	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(RING_OBJS) $(LIB) -o $@
> +	$(CC) $(LDFLAGS) $(RING_OBJS) $(ODP_LIB) -o $@
>   
>   .PHONY: clean
>   clean:
> @@ -75,6 +76,7 @@ clean:
>   	$(RM) $(ODP_ATOMIC)
>   	$(RM) $(ODP_SHM)
>   	$(RM) $(ODP_RING)
> +	$(MAKE) -C $(ODP_DIR) clean
>   
>   .PHONY: install
>   install:
> diff --git a/test/example/Makefile b/test/example/Makefile
> index d43e780..ba3940f 100644
> --- a/test/example/Makefile
> +++ b/test/example/Makefile
> @@ -6,24 +6,22 @@
>   ODP_ROOT = ../..
>   ODP_APP  = odp_example
>   
> -include ../Makefile.inc
>   include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
> +
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
> +
> +
> +CFLAGS  += -I.
>   
>   OBJS     =
>   OBJS    += $(OBJ_DIR)/odp_example.o
>   
>   DEPS     = $(OBJS:.o=.d)
>   
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> -
>   -include $(DEPS)
>   
> -$(DESTDIR)/lib/libodp.a:
> -	@test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -	$(MKDIR) $(OBJ_DIR)
>   
>   #
>   # Compile rules
> @@ -35,14 +33,15 @@ $(OBJ_DIR)/%.o: %.c
>   #
>   # Link rule
>   #
> -$(ODP_APP): $(OBJS)
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
>   	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>   
>   .PHONY: clean
>   clean:
>   	$(RMDIR) $(OBJ_DIR)
>   	$(RM) $(ODP_APP)
> +	$(MAKE) -C $(ODP_DIR) clean
>   
>   .PHONY: install
>   install:
> diff --git a/test/packet/Makefile b/test/packet/Makefile
> index f1cb7d9..83c813b 100644
> --- a/test/packet/Makefile
> +++ b/test/packet/Makefile
> @@ -6,27 +6,21 @@
>   ODP_ROOT = ../..
>   ODP_APP  = odp_packet
>   
> -include ../Makefile.inc
> -include $(ODP_ROOT)/Makefile.inc
> +CFLAGS  += -I.
>   
> -CFLAGS  += -I$(ODP_TEST_ROOT)/packet
> +include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
>   
>   OBJS     =
>   OBJS    += $(OBJ_DIR)/odp_example_pktio.o
>   
>   DEPS     = $(OBJS:.o=.d)
>   
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
>   
>   -include $(DEPS)
>   
> -$(DESTDIR)/lib/libodp.a:
> -	@test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -	$(MKDIR) $(OBJ_DIR)
> -
>   #
>   # Compile rules
>   #
> @@ -37,14 +31,14 @@ $(OBJ_DIR)/%.o: %.c
>   #
>   # Link rule
>   #
> -$(ODP_APP): $(OBJS)
> -	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
> +	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>   
>   .PHONY: clean
>   clean:
>   	$(RMDIR) $(OBJ_DIR)
>   	$(RM) $(ODP_APP)
> +	$(MAKE) -C $(ODP_DIR) clean
>   
>   .PHONY: install
>   install:
> diff --git a/test/packet_netmap/Makefile b/test/packet_netmap/Makefile
> index 5febb33..1ef0df1 100644
> --- a/test/packet_netmap/Makefile
> +++ b/test/packet_netmap/Makefile
> @@ -6,28 +6,22 @@
>   ODP_ROOT = ../..
>   ODP_APP  = odp_packet
>   
> +CFLAGS  += -I.
>   CFLAGS  += -DODP_HAVE_NETMAP
> -CFLAGS  += -O0 -g
>   
> -include ../Makefile.inc
>   include $(ODP_ROOT)/Makefile.inc
> +include ../Makefile.inc
>   
>   OBJS     =
>   OBJS    += $(OBJ_DIR)/odp_example_pktio_netmap.o
>   
>   DEPS     = $(OBJS:.o=.d)
>   
> -.PHONY: all
> -all: $(OBJ_DIR) $(ODP_APP)
> +.PHONY: default
> +default: $(OBJ_DIR) $(ODP_APP)
>   
>   -include $(DEPS)
>   
> -$(DESTDIR)/lib/libodp.a:
> -	@test -e $@ || (echo "$@ is missing" && false)
> -
> -$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
> -	$(MKDIR) $(OBJ_DIR)
> -
>   #
>   # Compile rules
>   #
> @@ -38,14 +32,14 @@ $(OBJ_DIR)/%.o: %.c
>   #
>   # Link rule
>   #
> -$(ODP_APP): $(OBJS)
> -	$(ECHO) Linking $<
> -	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
> +$(ODP_APP): $(ODP_LIB) $(OBJS)
> +	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
>   
>   .PHONY: clean
>   clean:
>   	$(RMDIR) $(OBJ_DIR)
>   	$(RM) $(ODP_APP)
> +	$(MAKE) -C $(ODP_DIR) clean
>   
>   .PHONY: install
>   install:
diff mbox

Patch

diff --git a/Makefile b/Makefile
index f086750..2512343 100644
--- a/Makefile
+++ b/Makefile
@@ -5,10 +5,9 @@ 
 
 .DEFAULT_GOAL := default
 
-ODP_ROOT      = $(PWD)
-ODP_TESTS     = $(ODP_ROOT)/test
-PLATFORM_ROOT = $(ODP_ROOT)/platform/$(PLATFORM)
-INCLUDE       = -I$(ODP_ROOT)/include
+ODP_ROOT        = $(PWD)
+ODP_TESTS       = $(ODP_ROOT)/test
+export DESTDIR  = $(ODP_ROOT)/build
 
 include $(ODP_ROOT)/Makefile.inc
 
@@ -28,19 +27,19 @@  tests: libs_install
 
 .PHONY: docs
 docs:
-	$(MAKE) -C $(PLATFORM_ROOT) docs
+	$(MAKE) -C $(ODP_DIR) docs
 
 .PHONY: docs_install
 docs_install: docs
-	$(MAKE) -C $(PLATFORM_ROOT) docs_install
+	$(MAKE) -C $(ODP_DIR) docs_install
 
 .PHONY: lib
 lib:
-	$(MAKE) -C $(PLATFORM_ROOT) libs
+	$(MAKE) -C $(ODP_DIR) libs
 
 .PHONY: clean
 clean:
-	$(MAKE) -C $(PLATFORM_ROOT) clean
+	$(MAKE) -C $(ODP_DIR) clean
 	$(MAKE) -C $(ODP_TESTS) clean
 
 .PHONY: libs_install
diff --git a/Makefile.inc b/Makefile.inc
index 523385d..1af7643 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -4,27 +4,35 @@ 
 # SPDX-License-Identifier:	BSD-3-Clause
 
 PLATFORM ?= linux-generic
-CFLAGS  += -DODP_DEBUG=1
-CFLAGS  += -O3
-#CFLAGS  += -O0 -g
+OBJ_DIR   = ./obj
+ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
 
-OBJ_DIR  = ./obj
-DESTDIR ?= $(ODP_ROOT)/build
-
-CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
-CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-CFLAGS += -Wformat-security -Wundef -Wwrite-strings
 
 CC     ?= gcc
 LD     ?= gcc
 AR     ?= ar
-
-ECHO   := echo
+ECHO   := @echo
 MKDIR  := mkdir -p
 RMDIR  := rm -rf
 RM     := rm -f
 COPY   := cp -r
 
-CFLAGS  += -pthread
+CFLAGS += -DODP_DEBUG=1
+CFLAGS += -O3
+#CFLAGS += -O0 -g
+CFLAGS += -pthread
+CFLAGS += -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
+CFLAGS += -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
+CFLAGS += -Wformat-security -Wundef -Wwrite-strings
+
+
 LDFLAGS += -pthread
+LDFLAGS += -lrt
+LDFLAGS += $(EXTRA_CFLAGS)
+
+.PHONY: default
+default:
+
+$(OBJ_DIR):
+	$(MKDIR) $(OBJ_DIR)
diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile
index b640928..676d4bf 100644
--- a/platform/linux-generic/Makefile
+++ b/platform/linux-generic/Makefile
@@ -78,8 +78,8 @@  all: libs docs
 
 -include $(DEPS)
 
-$(OBJ_DIR):
-	$(MKDIR) $(OBJ_DIR)
+#$(OBJ_DIR):
+#	$(MKDIR) $(OBJ_DIR)
 
 $(LIB_DIR):
 	$(MKDIR) $(LIB_DIR)
diff --git a/test/Makefile.inc b/test/Makefile.inc
index 72bbebd..1bb6a3c 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -3,10 +3,21 @@ 
 #
 # SPDX-License-Identifier:	BSD-3-Clause
 
-ODP_TEST_ROOT = $(ODP_ROOT)/test
 
+ifdef DESTDIR
+
+ODP_LIB = $(DESTDIR)/lib/libodp.a
 CFLAGS += -I$(DESTDIR)/include
-LIB = -L$(DESTDIR)/lib -lodp
+CFLAGS += -I$(DESTDIR)/include/api
+
+else
+
+ODP_LIB = $(ODP_DIR)/lib/libodp.a
+CFLAGS += -I$(ODP_ROOT)/include
+CFLAGS += -I$(ODP_DIR)/include/api
+
+$(ODP_LIB):
+	@echo Building $@
+	$(MAKE) -C $(ODP_DIR) libs
 
-LDFLAGS += -lrt
-LDFLAGS += $(EXTRA_CFLAGS)
+endif
diff --git a/test/api_test/Makefile b/test/api_test/Makefile
index 15c18f4..1c90174 100644
--- a/test/api_test/Makefile
+++ b/test/api_test/Makefile
@@ -12,12 +12,19 @@  ODP_ATOMIC    = odp_atomic
 ODP_SHM       = odp_shm
 ODP_RING      = odp_ring
 
-CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
-
-include ../Makefile.inc
 include $(ODP_ROOT)/Makefile.inc
+include ../Makefile.inc
+
+.PHONY: default
+default: all
+
+CFLAGS  += -I.
+#CFLAGS  += -I$(ODP_LIB)
+#CFLAGS  += -I$(ODP_ROOT)/platform/linux-generic/include
+#CFLAGS  += -I$(ARCH_INC)
+#CFLAGS  += -DODP_TEST_ATOMIC
+
 
-CFLAGS      += -I$(ODP_TEST_ROOT)/api_test
 
 ATOMIC_OBJS  =
 ATOMIC_OBJS += $(OBJ_DIR)/odp_common.o
@@ -41,12 +48,6 @@  ring: $(OBJ_DIR) $(ODP_RING)
 
 -include $(DEPS)
 
-$(DESTDIR)/lib/libodp.a:
-	@test -e $@ || (echo "$@ is missing" && false)
-
-$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
-	$(MKDIR) $(OBJ_DIR)
-
 #
 # Compile rules
 #
@@ -57,17 +58,17 @@  $(OBJ_DIR)/%.o: %.c
 #
 # Link rule
 #
-$(ODP_ATOMIC): $(ATOMIC_OBJS)
+$(ODP_ATOMIC): $(ODP_LIB) $(ATOMIC_OBJS)
 	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(LIB) -o $@
+	$(CC) $(LDFLAGS) $(ATOMIC_OBJS) $(ODP_LIB) -o $@
 
-$(ODP_SHM): $(SHM_OBJS)
+$(ODP_SHM): $(ODP_LIB) $(SHM_OBJS)
 	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(SHM_OBJS) $(LIB) -o $@
+	$(CC) $(LDFLAGS) $(SHM_OBJS) $(ODP_LIB) -o $@
 
-$(ODP_RING): $(RING_OBJS)
+$(ODP_RING): $(ODP_LIB) $(RING_OBJS)
 	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(RING_OBJS) $(LIB) -o $@
+	$(CC) $(LDFLAGS) $(RING_OBJS) $(ODP_LIB) -o $@
 
 .PHONY: clean
 clean:
@@ -75,6 +76,7 @@  clean:
 	$(RM) $(ODP_ATOMIC)
 	$(RM) $(ODP_SHM)
 	$(RM) $(ODP_RING)
+	$(MAKE) -C $(ODP_DIR) clean
 
 .PHONY: install
 install:
diff --git a/test/example/Makefile b/test/example/Makefile
index d43e780..ba3940f 100644
--- a/test/example/Makefile
+++ b/test/example/Makefile
@@ -6,24 +6,22 @@ 
 ODP_ROOT = ../..
 ODP_APP  = odp_example
 
-include ../Makefile.inc
 include $(ODP_ROOT)/Makefile.inc
+include ../Makefile.inc
+
+.PHONY: default
+default: $(OBJ_DIR) $(ODP_APP)
+
+
+CFLAGS  += -I.
 
 OBJS     =
 OBJS    += $(OBJ_DIR)/odp_example.o
 
 DEPS     = $(OBJS:.o=.d)
 
-.PHONY: all
-all: $(OBJ_DIR) $(ODP_APP)
-
 -include $(DEPS)
 
-$(DESTDIR)/lib/libodp.a:
-	@test -e $@ || (echo "$@ is missing" && false)
-
-$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
-	$(MKDIR) $(OBJ_DIR)
 
 #
 # Compile rules
@@ -35,14 +33,15 @@  $(OBJ_DIR)/%.o: %.c
 #
 # Link rule
 #
-$(ODP_APP): $(OBJS)
+$(ODP_APP): $(ODP_LIB) $(OBJS)
 	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
+	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
 
 .PHONY: clean
 clean:
 	$(RMDIR) $(OBJ_DIR)
 	$(RM) $(ODP_APP)
+	$(MAKE) -C $(ODP_DIR) clean
 
 .PHONY: install
 install:
diff --git a/test/packet/Makefile b/test/packet/Makefile
index f1cb7d9..83c813b 100644
--- a/test/packet/Makefile
+++ b/test/packet/Makefile
@@ -6,27 +6,21 @@ 
 ODP_ROOT = ../..
 ODP_APP  = odp_packet
 
-include ../Makefile.inc
-include $(ODP_ROOT)/Makefile.inc
+CFLAGS  += -I.
 
-CFLAGS  += -I$(ODP_TEST_ROOT)/packet
+include $(ODP_ROOT)/Makefile.inc
+include ../Makefile.inc
 
 OBJS     =
 OBJS    += $(OBJ_DIR)/odp_example_pktio.o
 
 DEPS     = $(OBJS:.o=.d)
 
-.PHONY: all
-all: $(OBJ_DIR) $(ODP_APP)
+.PHONY: default
+default: $(OBJ_DIR) $(ODP_APP)
 
 -include $(DEPS)
 
-$(DESTDIR)/lib/libodp.a:
-	@test -e $@ || (echo "$@ is missing" && false)
-
-$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
-	$(MKDIR) $(OBJ_DIR)
-
 #
 # Compile rules
 #
@@ -37,14 +31,14 @@  $(OBJ_DIR)/%.o: %.c
 #
 # Link rule
 #
-$(ODP_APP): $(OBJS)
-	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
+$(ODP_APP): $(ODP_LIB) $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
 
 .PHONY: clean
 clean:
 	$(RMDIR) $(OBJ_DIR)
 	$(RM) $(ODP_APP)
+	$(MAKE) -C $(ODP_DIR) clean
 
 .PHONY: install
 install:
diff --git a/test/packet_netmap/Makefile b/test/packet_netmap/Makefile
index 5febb33..1ef0df1 100644
--- a/test/packet_netmap/Makefile
+++ b/test/packet_netmap/Makefile
@@ -6,28 +6,22 @@ 
 ODP_ROOT = ../..
 ODP_APP  = odp_packet
 
+CFLAGS  += -I.
 CFLAGS  += -DODP_HAVE_NETMAP
-CFLAGS  += -O0 -g
 
-include ../Makefile.inc
 include $(ODP_ROOT)/Makefile.inc
+include ../Makefile.inc
 
 OBJS     =
 OBJS    += $(OBJ_DIR)/odp_example_pktio_netmap.o
 
 DEPS     = $(OBJS:.o=.d)
 
-.PHONY: all
-all: $(OBJ_DIR) $(ODP_APP)
+.PHONY: default
+default: $(OBJ_DIR) $(ODP_APP)
 
 -include $(DEPS)
 
-$(DESTDIR)/lib/libodp.a:
-	@test -e $@ || (echo "$@ is missing" && false)
-
-$(OBJ_DIR): $(DESTDIR)/lib/libodp.a
-	$(MKDIR) $(OBJ_DIR)
-
 #
 # Compile rules
 #
@@ -38,14 +32,14 @@  $(OBJ_DIR)/%.o: %.c
 #
 # Link rule
 #
-$(ODP_APP): $(OBJS)
-	$(ECHO) Linking $<
-	$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
+$(ODP_APP): $(ODP_LIB) $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) $(ODP_LIB) -o $@
 
 .PHONY: clean
 clean:
 	$(RMDIR) $(OBJ_DIR)
 	$(RM) $(ODP_APP)
+	$(MAKE) -C $(ODP_DIR) clean
 
 .PHONY: install
 install: