Makefile 638 B

12345678910111213141516171819202122232425
  1. ifeq ($(ARCH), x86_64)
  2. CROSS_COMPILE=x86_64-linux-musl-
  3. else ifeq ($(ARCH), riscv64)
  4. CROSS_COMPILE=riscv64-linux-musl-
  5. endif
  6. CC=$(CROSS_COMPILE)gcc
  7. NAME_PREFIX=test_shm_
  8. all: sender.c receiver.c test_info.c
  9. $(CC) -static -o $(NAME_PREFIX)sender sender.c
  10. $(CC) -static -o $(NAME_PREFIX)receiver receiver.c
  11. $(CC) -static -o $(NAME_PREFIX)info test_info.c
  12. .PHONY: install clean
  13. install: all
  14. mv $(NAME_PREFIX)sender $(DADK_CURRENT_BUILD_DIR)/
  15. mv $(NAME_PREFIX)receiver $(DADK_CURRENT_BUILD_DIR)/
  16. mv $(NAME_PREFIX)info $(DADK_CURRENT_BUILD_DIR)/
  17. clean:
  18. rm $(NAME_PREFIX)receiver $(NAME_PREFIX)sender $(NAME_PREFIX)info *.o
  19. fmt: