Bug 1461 - Makefile depends on the version of "make" command
Makefile depends on the version of "make" command
Status: CLOSED WORKSFORME
Product: dce
Classification: Unclassified
Component: kernel
unspecified
All All
: P5 normal
Assigned To: Hajime Tazaki
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-21 02:11 EDT by Hajime Tazaki
Modified: 2012-09-27 02:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Tazaki 2012-06-21 02:11:32 EDT
in the current version of ns-3-linux, the Makefile.print needs to modify if the version of make command changed. for example, in Ubuntu 10.04, using GNU Make 3.81, the separator after $@ is required, while 3.82 is not required.


@$(MAKE) -s -f $(firstword $(MAKEFILE_LIST)) objdir=$(objdir)$@/ config=$(config) srcdir=$(srcdir) $@/
Comment 1 Hajime Tazaki 2012-06-21 03:32:44 EDT
These code are ugly one, but works fine.

diff -r e5505327aee5 Makefile.print
--- a/Makefile.print    Thu Feb 09 13:34:55 2012 +0100
+++ b/Makefile.print    Thu Jun 21 16:31:22 2012 +0900
@@ -3,6 +3,13 @@
 include $(config)
 include $(srcdir)Makefile
 
+# fix minor nits for make version dependencies
+ifeq (3.82,$(firstword $(sort $(MAKE_VERSION) 3.82)))
+  SEPARATOR=
+else
+  SEPARATOR=/
+endif
+
 to_keep_list=$(subst :, ,$(to_keep))
 obj-y += $(lib-y)
 obj-m += $(lib-m)
@@ -31,4 +38,4 @@
        @echo -n $(addprefix $(objdir),$(@:.o=.ko)); echo -n "="
        @echo $(addprefix $(objdir),$(if $($(@:.o=-objs)),$($(@:.o=-objs)),$@))
 $(subdirs):
-       @$(MAKE) -s -f $(firstword $(MAKEFILE_LIST)) objdir=$(objdir)$@ config=$(config) srcdir=$(srcdir)$@ to_keep=$(to_keep) print 2>/dev/null
+       @$(MAKE) -s -f $(firstword $(MAKEFILE_LIST)) objdir=$(objdir)$@$(SEPARATOR) config=$(config) srcdir=$(srcdir)$@$(SEPARATOR) to_keep=$(to_keep) print 2>/dev/null
Comment 2 Hajime Tazaki 2012-06-21 10:28:28 EDT
pushed as
 changeset 58 e0a3fe869908
http://code.nsnam.org/furbani/ns-3-linux/rev/e0a3fe869908