Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. FEATURES_H = src/inet/features.h
  2. .PHONY: all clean cleanall makefiles makefiles-so makefiles-lib makefiles-exe checkmakefiles doxy doc submodule-init
  3. all: checkmakefiles $(FEATURES_H)
  4. cd src && $(MAKE)
  5. clean: checkmakefiles
  6. cd src && $(MAKE) clean
  7. cleanall: checkmakefiles
  8. @cd src && $(MAKE) MODE=release clean
  9. @cd src && $(MAKE) MODE=debug clean
  10. @rm -f src/Makefile $(FEATURES_H)
  11. @cd tutorials && $(MAKE) clean && rm -rf doc/tutorials
  12. MAKEMAKE_OPTIONS := -f --deep -o INET -O out -pINET -I.
  13. makefiles: makefiles-so
  14. makefiles-so: $(FEATURES_H)
  15. @FEATURE_OPTIONS=$$(./inet_featuretool options -f -l) && cd src && opp_makemake --make-so $(MAKEMAKE_OPTIONS) $$FEATURE_OPTIONS
  16. makefiles-lib: $(FEATURES_H)
  17. @FEATURE_OPTIONS=$$(./inet_featuretool options -f -l) && cd src && opp_makemake --make-lib $(MAKEMAKE_OPTIONS) $$FEATURE_OPTIONS
  18. makefiles-exe: $(FEATURES_H)
  19. @FEATURE_OPTIONS=$$(./inet_featuretool options -f -l) && cd src && opp_makemake $(MAKEMAKE_OPTIONS) $$FEATURE_OPTIONS
  20. checkmakefiles: submodule-init
  21. @if [ ! -f src/Makefile ]; then \
  22. echo; \
  23. echo '========================================================================'; \
  24. echo 'src/Makefile does not exist. Please use "make makefiles" to generate it!'; \
  25. echo '========================================================================'; \
  26. echo; \
  27. exit 1; \
  28. fi
  29. submodule-init:
  30. @if [ -d .git ]; then \
  31. if [ ! -f tutorials/package.ned ]; then \
  32. echo 'Fetching git submodules (tutorials, showcases)...'; \
  33. git submodule update --init; \
  34. fi \
  35. fi
  36. # generate an include file that contains all the WITH_FEATURE macros according to the current enablement of features
  37. $(FEATURES_H): $(wildcard .oppfeaturestate) .oppfeatures
  38. @./inet_featuretool defines >$(FEATURES_H)
  39. doc:
  40. cd tutorials && $(MAKE) && mkdir -p ../doc/tutorials/wireless && cp -r wireless/html/* ../doc/tutorials/wireless
  41. cd doc/src/tcp && $(MAKE)
  42. cd doc/src/manual && $(MAKE)
  43. doxygen doxy.cfg