📄 makefile
字号:
## Copyright 2006 Mark Lisee, Boleslaw K. Szymanski and Rensselaer Polytechnic# Institute. All worldwide rights reserved. A license to use, copy, modify# and distribute this software for non-commercial research purposes only is# hereby granted, provided that this copyright notice and accompanying# disclaimer is not modified or removed from the software.## DISCLAIMER: The software is distributed "AS IS" without any express or# implied warranty, including but not limited to, any implied warranties of# merchantability or fitness for a particular purpose or any warranty of# non-infringement of any current or pending patent rights. The authors of# the software make no representations about the suitability of this software# for any particular purpose. The entire risk as to the quality and# performance of the software is with the user. Should the software prove# defective, the user assumes the cost of all necessary servicing, repair or# correction. In particular, neither Rensselaer Polytechnic Institute, nor# the authors of the software are liable for any indirect, special,# consequential, or incidental damages related to the software, to the maximum# extent the law permits.#include ../../optimizations.mkinclude ../../definitions.mk# These depend on sim_shr.hSHR_TARGETS = sim_shr_dist_ack sim_shr_loc_ack sim_shr_ack sim_shrSHR_OBJS = $(SHR_TARGETS:%=%.o)# These depend on sim_routing.ccMOST_ROUTING_TARGETS = sim_flooding sim_aodv sim_dsrMOST_ROUTING_OBJS = $(MOST_ROUTING_TARGETS:%=%.o)ROUTING_TARGETS = $(MOST_ROUTING_TARGETS) sim_aodviiROUTING_OBJS = $(ROUTING_TARGETS:%=%.o)# These depend on sim_80211.ccMAC_TARGETS = sim_80211 sim_nullmacMAC_OBJS = $(MAC_TARGETS:%=%.o)# These depend on sim_ssab.ccSSAB_TARGETS = sim_ssab sim_no_ssabSSAB_OBJS = $(SSAB_TARGETS:%=%.o)MAKE=TARGETS = $(ROUTING_TARGETS)TARGETS += $(SHR_TARGETS)TARGETS += $(MAC_TARGETS)TARGETS += $(SSAB_TARGETS)#TARGETS += sim_ashrOBJS = $(TARGETS:%=%.o)SIM_CMN_HDRS = ../../common/cost.h ../../common/sense.h ../../phy/transceiver.h ../../energy/power.h ../../energy/battery.hSIM_RADIO_HDRS = ../../phy/simple_channel.h ../../mob/immobile.h ../../phy/transceiver.hSIM_MAC_HDRS= ../../mac/null_mac.h ../../mac/mac_80211.hSIM_ROUTING_HDRS = $(SIM_CMN_HDRS) $(SIM_RADIO_HDRS) $(SIM_MAC_HDRS) ../../net/aodvi.h ../../net/aodvii.h ../../net/dsri.hSIM_80211_HDRS = $(SIM_CMN_HDRS) $(SIM_RADIO_HDRS) $(SIM_MAC_HDRS) ../../app/random_neighbor.hSIM_SSAB_HDRS = $(SIM_CMN_HDRS) $(SIM_RADIO_HDRS) ../../mac/bcast_mac.h ../../app/cbr.h ../../net/ssab.hSIM_SHR_CMN_HDRS = $(SIM_CMN_HDRS) sim_shr.h ../../net/shr.h ../../mac/bcast_mac.h ../../app/cbr.hSIM_SHR_LOC_HDRS = ../../phy/simple_channel_loc.h ../../mob/immobile_loc.h ../../phy/transceiver_loc.hSIM_SHR_DIST_HDRS = ../../phy/simple_channel_dist.h ../../mob/immobile.h ../../phy/transceiver_loc.hSIM_SHR_RADIO_HDRS = $(SIM_RADIO_HDRS)COMMON_LIBS = visualizer configParser y flCOMMON_LIB_FILES = ../../libraries/visualizer/lib/libvisualizer.a ../../libraries/parseConfig/lib/libconfigParser.aCOMMON_LIB_DIRS = -L../../libraries/visualizer/lib -L../../libraries/parseConfig/lib# By default, build everythingall: $(TARGETS)#################### Convert .cc to .cxx ##################### The .cxx file is generated by using cxx on the .cc file.# Targets that depend on sim_routing.ccsim_flooding.cxx: sim_routing.cc $(SIM_ROUTING_HDRS) $(COMPCXX) -Dnet_component=Flooding -Dnet_struct=Flooding_Struct $< mv sim_routing.cxx $@sim_aodv.cxx: sim_routing.cc $(SIM_ROUTING_HDRS) $(COMPCXX) -Dnet_component=AODVI -Dnet_struct=AODVI_Struct $< mv sim_routing.cxx $@sim_aodvii.cxx: sim_routing.cc $(SIM_ROUTING_HDRS) $(COMPCXX) -Dnet_component=AODVII -Dnet_struct=AODVII_Struct $< mv sim_routing.cxx $@sim_dsr.cxx: sim_routing.cc $(SIM_ROUTING_HDRS) $(COMPCXX) -Dnet_component=DSRI -Dnet_struct=DSRI_Struct $< mv sim_routing.cxx $@# Targets that depend on sim_80211.ccsim_80211.cxx: sim_80211.cc $(SIM_80211_HDRS) $(COMPCXX) $<sim_nullmac.cxx: sim_80211.cc $(SIM_80211_HDRS) $(COMPCXX) -Dmac_component=NullMAC -Dmac_struct=NullMAC_Struct $< mv sim_80211.cxx $@# Targets that depend on sim_ssab.ccsim_ssab.cxx: sim_ssab.cc $(SIM_SSAB_HDRS) $(COMPCXX) $<# Targets that depend on sim_shr.hsim_shr.cxx: %.cxx: %.cc $(SIM_SHR_CMN_HDRS) $(SIM_SHR_RADIO_HDRS) $(COMPCXX) $<sim_shr_dist.cxx: %.cxx: %.cc $(SIM_SHR_CMN_HDRS) $(SIM_SHR_DIST_HDRS) $(COMPCXX) $<sim_shr_loc.cxx: %.cxx: %.cc $(SIM_SHR_CMN_HDRS) $(SIM_SHR_LOC_HDRS) $(COMPCXX) $<#################### Compile .cxx to .o ##################### The .o file is generated by using g++ on the .cxx filesim_shr.o $(MOST_ROUTING_OBJS) $(MAC_OBJS): %.o: %.cxx $(CC) $(CCFLAGS) -c -o $@ $^# These object files are generated from the .cxx file with the same stem, less# the "_ack".sim_shr_ack.o: %_ack.o: %.cxx $(CC) $(CCFLAGS) -DSHR_ACK -c -o $@ $^sim_shr_loc_ack.o sim_shr_dist_ack.o: %_ack.o: %.cxx $(CC) $(CCFLAGS) -DUSE_CONFIG_FILE -DSHR_ACK -c -o $@ $^sim_aodvii.o: %.o: %.cxx $(CC) $(CCFLAGS) -DQUEUE_NOBUFFER -c -o $@ $^sim_ssab.o: %.o: %.cxx $(CC) $(CCFLAGS) -DUSING_SSAB -c -o $@ $^sim_no_ssab.o: sim_ssab.cxx $(CC) $(CCFLAGS) -c -o $@ $^#################### Link .o files into targets ##################### Link the correct .o file with the configuration and visualizer libraries$(TARGETS): %: %.o $(COMMON_LIB_FILES) $(CC) -o $@ $< $(COMMON_LIB_DIRS) $(COMMON_LIBS:%=-l%)#sim_ashr.cxx: sim_ashr.cc ../../net/ashr.h# $(COMPCXX) sim_ashr.cc#sim_ashr: sim_ashr.cxx# $(CC) $(CCFLAGS) -o $@ sim_ashr.cxx#sim_ashr_ack: sim_ashr.cxx# $(CC) $(CCFLAGS) -DSHR_ACK -o $@ sim_ashr.cxx# mwl: remove SHR_ACK from ashrclean: rm -f $(TARGETS) $(OBJS) *.exe *.exe.stackdump *.cxx compcxx_*.h#################### test each executable ##################### The leading @ tells make not to echo the command.# The trailing \s are required to tell make to pass entire series of commands# to the shell at one time.test: @for file in $(TARGETS); do \ echo; echo "---------- $$file ----------"; echo; \ ./$$file; \ done
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -