#===================================================================== # # toplevel makefile for OMNeT++ libraries and programs # #===================================================================== # # Directories # OMNETPP_BIN_DIR = @OMNETPP_BIN_DIR@ OMNETPP_LIB_DIR = @OMNETPP_LIB_DIR@ OMNETPP_SRC_DIR = @OMNETPP_SRC_DIR@ OMNETPP_INCL_DIR = @OMNETPP_INCL_DIR@ OMNETPP_DOC_DIR = @OMNETPP_DOC_DIR@ OMNETPP_SAMPLES_DIR = @OMNETPP_SAMPLES_DIR@ OMNETPP_TUTORIAL_DIR = @OMNETPP_TUTORIAL_DIR@ OMNETPP_TEST_DIR = @OMNETPP_TEST_DIR@ #===================================================================== # # Main targets # #===================================================================== all: check-env components components: libs progs samples tutorials #===================================================================== # # OMNeT++ components # #===================================================================== LIBS=sim nedxml envir cmdenv tkenv PROGS=utils nedc gned plove SAMPLES=dyna dyna2 fddi fifo1 fifo2 hcube hist nim token topo demo # # Group targets. Note that utils has to be built BEFORE other libs and progs # because tcl2c might be needed to build tkenv or gned. # libs: utils $(LIBS) progs: $(PROGS) samples: $(SAMPLES) docs: api nedxml-api manual # # Libraries # sim: cd $(OMNETPP_SRC_DIR)/sim && $(MAKE) nedxml: cd $(OMNETPP_SRC_DIR)/nedxml && $(MAKE) envir: cd $(OMNETPP_SRC_DIR)/envir && $(MAKE) cmdenv: cd $(OMNETPP_SRC_DIR)/cmdenv && $(MAKE) tkenv: cd $(OMNETPP_SRC_DIR)/tkenv && $(MAKE) # # Programs # nedc: cd $(OMNETPP_SRC_DIR)/nedc && $(MAKE) gned: cd $(OMNETPP_SRC_DIR)/gned && $(MAKE) plove: cd $(OMNETPP_SRC_DIR)/plove && $(MAKE) utils: cd $(OMNETPP_SRC_DIR)/utils && $(MAKE) # # Sample programs # dyna: cd $(OMNETPP_SAMPLES_DIR)/dyna && $(MAKE) fddi: cd $(OMNETPP_SAMPLES_DIR)/fddi && $(MAKE) fifo1: cd $(OMNETPP_SAMPLES_DIR)/fifo1 && $(MAKE) fifo2: cd $(OMNETPP_SAMPLES_DIR)/fifo2 && $(MAKE) hcube: cd $(OMNETPP_SAMPLES_DIR)/hcube && $(MAKE) hist: cd $(OMNETPP_SAMPLES_DIR)/hist && $(MAKE) nim: cd $(OMNETPP_SAMPLES_DIR)/nim && $(MAKE) token: cd $(OMNETPP_SAMPLES_DIR)/token && $(MAKE) dyna2: cd $(OMNETPP_SAMPLES_DIR)/dyna2 && $(MAKE) topo: cd $(OMNETPP_SAMPLES_DIR)/topo && $(MAKE) demo: cd $(OMNETPP_SAMPLES_DIR)/demo && $(MAKE) tutorials: cd $(OMNETPP_TUTORIAL_DIR)/queues && $(MAKE) # # Documentation # api: cd $(OMNETPP_INCL_DIR) && $(MAKE) doc nedxml-api: cd $(OMNETPP_SRC_DIR)/nedxml && $(MAKE) doc manual: cd $(OMNETPP_DOC_DIR)/usman && $(MAKE) # # Test # tests: libs progs cd $(OMNETPP_TEST_DIR) && $(MAKE) #===================================================================== # # Utilities # #===================================================================== check-env: @probefile=__probe__; \ if (echo '' >@OMNETPP_BIN_DIR@/$$probefile && \ chmod +x @OMNETPP_BIN_DIR@/$$probefile) 2>/dev/null; then \ if $$probefile >/dev/null 2>/dev/null; then :; else \ echo ' *** Warning: @OMNETPP_BIN_DIR@ is not in the path, some components may not build!'; \ fi; \ else \ echo ' *** Warning: Cannot write to @OMNETPP_BIN_DIR@, does it exist?'; \ fi; \ rm -f @OMNETPP_BIN_DIR@/$$probefile; \ if uname | grep "CYGWIN" >/dev/null; then :; else \ if echo $$LD_LIBRARY_PATH | grep "@OMNETPP_LIB_DIR@" >/dev/null; then :; else \ echo ' *** Warning: Looks like @OMNETPP_LIB_DIR@ is not in LD_LIBRARY_PATH, shared libs may not work!'; \ fi; \ fi clean: for i in $(LIBS) $(PROGS); do \ (cd $(OMNETPP_SRC_DIR)/$$i && $(MAKE) clean); \ done - rm $(OMNETPP_BIN_DIR)/* - rm $(OMNETPP_LIB_DIR)/* for i in $(SAMPLES); do \ (cd $(OMNETPP_SAMPLES_DIR)/$$i && $(MAKE) clean); \ done cd $(OMNETPP_TUTORIAL_DIR)/queues && $(MAKE) clean cd $(OMNETPP_TEST_DIR) && $(MAKE) clean depend: utils for i in $(LIBS) $(PROGS); do \ (cd $(OMNETPP_SRC_DIR)/$$i && $(MAKE) depend); \ done for i in $(SAMPLES); do \ (cd $(OMNETPP_SAMPLES_DIR)/$$i && $(MAKE) depend); \ done