# # Toplevel makefile for OMNeT++ libraries and programs # #===================================================================== #===================================================================== # # Main targets # #===================================================================== ifeq ("$(MODE)","") all: allmodes else all: components endif allmodes: $(MAKE) MODE=release $(MAKE) MODE=debug components: base #===================================================================== # # Includes and basic checks # #===================================================================== include Makefile.inc # Make sure that output locations are set ifeq ("$(strip $(OMNETPP_BIN_DIR))","") $(error OMNETPP_BIN_DIR must be correctly set) endif ifeq ("$(strip $(OMNETPP_OUT_DIR))","") $(error OMNETPP_OUT_DIR must be correctly set) endif ifeq ("$(strip $(OMNETPP_LIB_DIR))","") $(error OMNETPP_LIB_DIR must be correctly set) endif #===================================================================== # # OMNeT++ components # #===================================================================== BASE=common layout eventlog scave nedxml sim envir cmdenv tkenv utils SAMPLES= JNILIBS=org.omnetpp.ned.model org.omnetpp.ide.nativelibs # # Group targets. # base: $(BASE) cd $(OMNETPP_SRC_DIR)/envir && $(MAKE) opp_run_executable ui: check-ui-vars common layout eventlog scave nedxml $(JNILIBS) # dependencies (because of ver.h, opp_msgc, etc) clean depend: makefiles common layout eventlog scave nedxml sim envir cmdenv tkenv makefiles: utils layout eventlog scave nedxml sim envir cmdenv tkenv : common envir : sim cmdenv tkenv : envir tkenv : layout sim : nedxml common $(BASE) : check-env queueinglibext : queueinglib .PHONY: check-env cleanall depend makefiles clean apis docu tests all allmodes \ components base ui common layout eventlog scave nedxml sim \ envir cmdenv tkenv utils # # Core libraries and programs # $(BASE): @echo ===== Compiling $@ ==== cd $(OMNETPP_SRC_DIR)/$@ && $(MAKE) # # Native libs for the UI # $(JNILIBS): nedxml @echo ===== Compiling $@ ==== cd $(OMNETPP_UI_DIR)/$@ && $(MAKE) clean cd $(OMNETPP_UI_DIR)/$@ && $(MAKE) nativelibs: nedxml @echo ===== Compiling $@ ===== cd ide/org.omnetpp.ide.nativelibs && $(MAKE) nativelibs-clean: cd ide/org.omnetpp.ide.nativelibs && $(MAKE) clean install-plugins: cp ide/org.omnetpp.ide.nativelibs/bin/$(PLATFORM)/* ide/plugins/org.omnetpp.ide.nativelibs.$(PLATFORM)_4.1.0.100611-4b63c38 cp ide/org.omnetpp.ide.nativelibs/bin/*.jar ide/plugins/ cp ide/org.omnetpp.sequencechart/bin/*.jar ide/plugins/ # # Documentation # apis: cd $(OMNETPP_DOC_DIR)/src && $(MAKE) apis docu: cd $(OMNETPP_DOC_DIR)/src && $(MAKE) # # Test # tests: base cd $(OMNETPP_TEST_DIR) && $(MAKE) #===================================================================== # # Utilities # #===================================================================== check-ui-vars: @if [ "$(BUILDING_UILIBS)" != "yes" ]; then echo 'ERROR: "make ui" must be invoked with BUILDING_UILIBS=yes!' && exit 1; fi check-env: @echo "***** Configuration: MODE=$(MODE), TOOLCHAIN_NAME=$(TOOLCHAIN_NAME), LIB_SUFFIX=$(LIB_SUFFIX) ****" @echo ===== Checking environment ===== mkdir -p $(OMNETPP_BIN_DIR) @probefile=__probe__; \ if (echo '#!/bin/sh' >$(OMNETPP_BIN_DIR)/$$probefile && \ chmod +x $(OMNETPP_BIN_DIR)/$$probefile) 2>/dev/null; then \ if $$probefile >/dev/null 2>/dev/null; then :; else \ echo 'ERROR: $(OMNETPP_BIN_DIR) is not in the path! You can add it by entering:'; \ echo ' export PATH=$(OMNETPP_BIN_DIR):$$PATH'; \ exit 1; \ fi; \ else \ echo 'ERROR: Cannot write to $(OMNETPP_BIN_DIR)! Please make sure it exists, and has write permission.'; \ exit 1; \ fi; \ rm -f $(OMNETPP_BIN_DIR)/$$probefile; \ clean: makefiles -rm -f $(OMNETPP_LIB_DIR)/*.* -rm -rf $(OMNETPP_OUT_DIR)/$(CONFIGNAME) -rm -rf $(OMNETPP_LIB_DIR)/$(CONFIGNAME) for i in $(BASE); do \ (cd $(OMNETPP_SRC_DIR)/$$i && $(MAKE) clean); \ done cleanall: makefiles -rm -rf $(OMNETPP_OUT_DIR) -rm -rf $(OMNETPP_LIB_DIR)/* for i in $(BASE); do \ (cd $(OMNETPP_SRC_DIR)/$$i && $(MAKE) clean); \ done # bin should be removed last because opp_configfilepath (in bin directory) is needed to clean -rm -rf $(OMNETPP_BIN_DIR)/* depend: for i in $(BASE); do \ (cd $(OMNETPP_SRC_DIR)/$$i && $(MAKE) depend); \ done makefiles: # copy the documentation to the UI doc folder too. # patch some files to have correct URLs and add generic eclipse stylsheet when needed copy-ui-docu: txt2html $(OMNETPP_DOC_DIR)/WhatsNew --outfile $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/WhatsNew.html rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/api rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/manual rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/userguide rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/migration rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/tictoc-tutorial rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-overview rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-customization-guide rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-developersguide cp -r $(OMNETPP_DOC_DIR)/ide-changelog $(OMNETPP_UI_DIR)/org.omnetpp.doc/content cp -r $(OMNETPP_DOC_DIR)/api $(OMNETPP_UI_DIR)/org.omnetpp.doc/content cp -r $(OMNETPP_DOC_DIR)/src/manual/eclipse $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/manual cp -r $(OMNETPP_DOC_DIR)/src/userguide/eclipse $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/userguide cp -r $(OMNETPP_DOC_DIR)/src/migrationguide/eclipse $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/migration cp -r $(OMNETPP_DOC_DIR)/tictoc-tutorial $(OMNETPP_UI_DIR)/org.omnetpp.doc/content cp -r $(OMNETPP_DOC_DIR)/ide-overview $(OMNETPP_UI_DIR)/org.omnetpp.doc/content cp -r $(OMNETPP_DOC_DIR)/src/ide-customization-guide/eclipse $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-customization-guide cp -r $(OMNETPP_DOC_DIR)/src/ide-developersguide/eclipse $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-developersguide echo "
" >$(OMNETPP_UI_DIR)/org.omnetpp.doc/content/License.html
	cat $(OMNETPP_DOC_DIR)/License >>$(OMNETPP_UI_DIR)/org.omnetpp.doc/content/License.html
	echo "
" >>$(OMNETPP_UI_DIR)/org.omnetpp.doc/content/License.html rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/userguide/plugin.xml rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/migration/plugin.xml rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-customization-guide/plugin.xml rm -rf $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-developersguide/plugin.xml perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/WhatsNew.html perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-overview/*.html perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-changelog/*.html perl -i -pe 's!href="!href="content/manual/!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/manual/toc.xml perl -i -pe 's!href="!href="content/userguide/!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/userguide/toc.xml perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/userguide/*.html perl -i -pe 's!href="!href="content/migration/!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/migration/toc.xml perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/migration/*.html perl -i -pe 's!href="!href="content/ide-customization-guide/!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-customization-guide/toc.xml perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-customization-guide/*.html perl -i -pe 's!href="!href="content/ide-developersguide/!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-developersguide/toc.xml perl -i -pe 's!!!gi' $(OMNETPP_UI_DIR)/org.omnetpp.doc/content/ide-developersguide/*.html ifeq ($(findstring linux,$(PLATFORM)),linux) generate-desktop-file: @echo "[Desktop Entry]\nEncoding=UTF-8\nType=Application\nExec=$(OMNETPP_BIN_DIR)/omnetpp\nIcon=$(OMNETPP_ROOT)/ide/icon.png\nName=$(OMNETPP_PRODUCT) $(OMNETPP_VERSION) IDE\nCategories=Development;IDE;Debugger\n" >opensim-ide.desktop install-menu-item: generate-desktop-file @xdg-desktop-menu uninstall opensim-ide.desktop @xdg-desktop-menu install opensim-ide.desktop @rm opensim-ide.desktop install-desktop-icon: generate-desktop-file @xdg-desktop-icon uninstall opensim-ide.desktop @xdg-desktop-icon install opensim-ide.desktop @rm opensim-ide.desktop else ifeq ($(findstring macosx,$(PLATFORM)),macosx) install-menu-item: ifeq ($(OMNETPP_PRODUCT),OMNEST) -ln -s -f $(OMNETPP_ROOT)/ide/omnest.app /Applications/'$(OMNETPP_PRODUCT) $(OMNETPP_VERSION) IDE' else -ln -s -f $(OMNETPP_ROOT)/ide/omnetpp.app /Applications/'$(OMNETPP_PRODUCT) $(OMNETPP_VERSION) IDE' endif install-desktop-icon: ifeq ($(OMNETPP_PRODUCT),OMNEST) -ln -s -f $(OMNETPP_ROOT)/ide/omnest.app ~/Desktop/'$(OMNETPP_PRODUCT) $(OMNETPP_VERSION) IDE' else -ln -s -f $(OMNETPP_ROOT)/ide/omnetpp.app ~/Desktop/'$(OMNETPP_PRODUCT) $(OMNETPP_VERSION) IDE' endif else ifeq ($(findstring win32,$(PLATFORM)),win32) endif