Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. TARGET_FILE=dist/package_dir/bin/euspace
  23. all: c-build go-build
  24. build:
  25. CGO_ENABLED=1 go build -gcflags="all=-N -l" -buildvcs=false -o dist/package_dir/bin/euspace
  26. c:
  27. docker exec -it 62d0676aa0b7 sh -c 'cd /opt/github/euspace/ebpftracer && make all ${PARAMS}'
  28. c-build: c
  29. go-build:
  30. docker exec -it 62d0676aa0b7 bash -c 'cd /opt/github/euspace && source ~/.g/env && make build'
  31. go: go-build run
  32. run:
  33. 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"'
  34. docker-build-c:
  35. cd /opt/github/euspace/ebpftracer && make all ${PARAMS}
  36. docker-build-go:
  37. source ~/.g/env; CGO_ENABLED=1 go build -a -gcflags="all=-N -l" -buildvcs=false -o ${TARGET_FILE}
  38. docker-build: docker-build-c docker-build-go
  39. @echo Target file: ${TARGET_FILE}
  40. @echo Euspaces build success!