Makefile 861 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. FILTER=
  2. PARAMS=
  3. # Set debug
  4. ifeq ($(debug),1)
  5. PARAMS+=debug=1
  6. endif
  7. # Set filter pid
  8. ifdef pid
  9. ifneq ($(pid),0)
  10. PARAMS+=pid=$(pid)
  11. FILTER=FILTER_PID=${pid}
  12. endif
  13. endif
  14. # Set send data
  15. ifeq ($(send),1)
  16. FILTER+= SEND=1
  17. endif
  18. # Set eBPF build kernel
  19. ifdef kernel
  20. PARAMS+= kernel=${kernel}
  21. endif
  22. all: c-build go-build
  23. build:
  24. CGO_ENABLED=1 go build -gcflags="all=-N -l" -buildvcs=false -o dist/package_dir/bin/euspace
  25. c:
  26. docker exec -it 62d0676aa0b7 sh -c 'cd /opt/github/euspace/ebpftracer && make all ${PARAMS}'
  27. c-build: c
  28. go-build:
  29. docker exec -it 62d0676aa0b7 bash -c 'cd /opt/github/euspace && source ~/.g/env && make build'
  30. go: go-build run
  31. run:
  32. ssh [email protected] 'cd /opt/github/euspace && CONFIG_ENDPOINT=10.0.16.250:18080 && TRACES_ENDPOINT=http://10.0.16.250:18080/docp/api/v2/data/receive ${FILTER} ./euspace --listen="0.0.0.0:8123"'