私の修士論文では、マルチパスネットワークの式をテストして評価するツールを開発しています。カスタムツールでtracerouteを使用しているときのコンパイルの問題
tracerouteツールを使用して、2つのマルチホームホスト間でネットワークをトレースするには、-sフラグ、src IPおよびdst IPを渡します。私は複数のソースとdestのIPを持っています。したがって、tracerouteは複数回実行されます。
私は編集物にうまくいかない。ウェブサイトhttps://sourceforge.net/projects/traceroute/files/traceroute/からダウンロードしたtraceroute-2.1.0のコードには、以下の "make"関連ファイルがあります。
- 私はtraceroute.cにコードに私の変更を適用している、と私はそれを正しくコンパイルできたMakefile
- make.defines
- make.rules
- default.rulesに
"make"と "make install"を実行します。しかし、これらの変更は、システムのtracerouteツール(明らかに)に対して行われます。
私が達成したいのは、 "traceroute"の代わりに "mytrace"のように新しい名前を付けることです。だからそれはtracerouteツールと矛盾して来ていないと私は両方のツールを使用することができます。 cmdlineで "traceroute"と "mytrace"で呼び出す
質問:それを達成するためには、再コンパイルする前に何をしなければならないのですか?
"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 [email protected]/Makefile),,-f
$(srcdir)/default.rules)
$(targets): force
@$(MAKE) $(mkfile) -C [email protected] $(what) [email protected]
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 [email protected]
@$(MAKE) store
store: distclean
@./store.sh $(NAME) $(STORE_DIR)
変更Makefileと –
@OleksandrKravchukザ・Makefileのは、私が今まで遭遇した小さなものとは違って、私のために少し複雑すぎる出力バイナリ名を変更します。私の記事で述べたように、makeルールは複数のファイルにまたがっています。投稿を編集してMakefileコードも含めました。 – Imran