p≡p for Java
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

  1. # Copyright 2018, pEp Foundation
  2. # This file is part of pEp JNI Adapter
  3. # This file may be used under the terms of the GNU General Public License version 3
  4. # see LICENSE.txt
  5. include ../../Makefile.conf
  6. MARKER_DIR=../../build/marker/
  7. PEP_HEADER:=$(shell $(CXX) $(CXXFLAGS) -E -M ../cxx/get_header.cc | grep -oe '[^[:space:]]*pEpEngine\.h' | head -1)
  8. # Every ysl2 file that needs to be "compiled" separately, needs to generate a "marker" file
  9. # The marker serves as the make target.
  10. # If the marker file is older than its corresponding ysl2 file, or not exsiting, the ysl2 file will be "compiled"
  11. # Naming:
  12. # For a ysl2 file called "gen_example_stuff.ysl2", a marker file called "gen_example_stuff.marker" is expected.
  13. YML2_MARKERS= \
  14. $(MARKER_DIR)/gen_java_Engine.marker \
  15. $(MARKER_DIR)/gen_java_Message.marker \
  16. $(MARKER_DIR)/gen_cpp_Engine.marker \
  17. $(MARKER_DIR)/gen_cpp_Message.marker \
  18. $(MARKER_DIR)/gen_throw_pEp_exception.marker
  19. # All code genration will be done upon change of these files
  20. YML2_INCLUDES= \
  21. textutils.ysl2 \
  22. types_c.ysl2 \
  23. types_java.ysl2
  24. .PHONY: all codegen gen-status-codes create-dirs remove-dirs clean
  25. all: codegen
  26. # ------------- YML2 CodeGen --------------
  27. codegen: create-dirs gen-status-codes $(YML2_MARKERS)
  28. $(YML2_MARKERS): $(MARKER_DIR)/%.marker : %.ysl2 pEp.yml2 $(YML2_INCLUDES)
  29. $(YML2_PROC) -y $< pEp.yml2
  30. gen-status-codes: pEp.yml2
  31. bash ../../utils/gen_status_codes.sh "$(PEP_HEADER)"
  32. # ------------- Housekeeping ---------------
  33. create-dirs:
  34. mkdir -p $(MARKER_DIR)
  35. #rm -rf is too dangerous for vars
  36. remove-dirs:
  37. rm -rf ../../build/marker
  38. clean: remove-dirs
  39. rm -f status_list.yml2
  40. rm -f passphrase_status_list.yml2