1

For my master thesis, I am developing a tool to test and evaluate a formula for multipath networks.

I will be using the traceroute tool to trace the network between two multihomed hosts by passing to it -s flag, src IP and dst IP. I have multiple source and dest IPs. So the traceroute will be performed multiple times.

I am not good with compilation stuff. The downloaded code for traceroute-2.1.0 from the website https://sourceforge.net/projects/traceroute/files/traceroute/ has following "make" related files.

  • Makefile
  • make.defines
  • make.rules
  • default.rules

I have applied my changes to the code in traceroute.c, and I can compile it properly by "make" and "make install". But these changes are made to the traceroute tool for the system(obviously).

What I want to achieve is, to have it with a new name, for example "mytrace" instead of "traceroute". So it doesnt come in conflict with the traceroute tool and I could use both tools. Calling with "traceroute" and other with "mytrace" in cmd line.

Question is: What changes I must make before recompiling, in order to achieve it.

Here is the code of the file "makefile".

#   Global Makefile.
#   Global rules, targets etc.
#
#   See Make.defines for specific configs.
#


srcdir = $(CURDIR)

override TARGET := .MAIN

dummy: all

include ./Make.rules


targets = $(EXEDIRS) $(LIBDIRS) $(MODDIRS)


# be happy, easy, perfomancy...
.PHONY: $(subdirs) dummy all force
.PHONY: depend indent clean distclean libclean release store libs mods


allprereq := $(EXEDIRS)

ifneq ($(LIBDIRS),)
libs: $(LIBDIRS)
ifneq ($(EXEDIRS),)
$(EXEDIRS): libs
else
allprereq += libs
endif
endif

ifneq ($(MODDIRS),)
mods: $(MODDIRS)
ifneq ($(MODUSERS),)
$(MODUSERS): mods
else
allprereq += mods
endif
ifneq ($(LIBDIRS),)
$(MODDIRS): libs
endif
endif

all: $(allprereq)

depend install: $(allprereq)

$(foreach goal,$(filter install-%,$(MAKECMDGOALS)),\
    $(eval $(goal): $(patsubst install-%,%,$(goal))))


what = all
depend: what = depend
install install-%: what = install

ifneq ($(share),)
$(share): shared = yes
endif
ifneq ($(noshare),)
$(noshare): shared = 
endif


$(targets): mkfile = $(if $(wildcard $@/Makefile),,-f 
$(srcdir)/default.rules)

$(targets): force
    @$(MAKE) $(mkfile) -C $@ $(what) TARGET=$@

force:


indent:
    find . -type f -name "*.[ch]" -print -exec $(INDENT) {} \;

clean:
    rm -f $(foreach exe, $(EXEDIRS), ./$(exe)/$(exe)) nohup.out
    rm -f `find . \( -name "*.[oa]" -o -name "*.[ls]o" \
        -o -name core -o -name "core.[0-9]*" -o -name a.out \) -print`

distclean: clean
    rm -f `find $(foreach dir, $(subdirs), $(dir)/.) \
        \( -name "*.[oa]" -o -name "*.[ls]o" \
        -o -name core -o -name "core.[0-9]*" -o -name a.out \
        -o -name .depend -o -name "_*" -o -name ".cross:*" \) \
        -print`


libclean:
    rm -f $(foreach lib, $(LIBDIRS), ./$(lib)/$(lib).a ./$(lib)/$(lib).so)


#  Rules to make whole-distributive operations.
#

STORE_DIR = $(HOME)/pub

release release1 release2 release3:
    @./chvers.sh $@
    @$(MAKE) store

store: distclean
    @./store.sh $(NAME) $(STORE_DIR)
Imran
  • 11
  • 2
  • 1
    Modify Makefile and change the output binary name – Oleksandr Kravchuk Oct 26 '17 at 15:10
  • @OleksandrKravchuk The Makefile is a bit too complex for me, unlike the smaller ones that I have encountered till now. The make rules are spanning multiple files as I have mentioned in my post. I edited the post to include the Makefile code as well. – Imran Oct 26 '17 at 21:15

1 Answers1

0

I wrote to the programmer of the tool, his solution worked for me. Here it is:

Just rename the sub-directory "traceroute" to another name, say "mytrace". IOW, you'll have "include, libsupp, mytrace" instead of "include, libsupp, traceroute".

Additionally, if you plan to create a tarball with the changed name etc., it seems that you have to rename "NAME = traceroute" to "NAME = mytrace" in the Make.defines file. Best regards, Dmitry Butskoy

Imran
  • 11
  • 2