Makefile.rules 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ifeq ("$(origin V)", "command line")
  2. BUILD_VERBOSE = $(V)
  3. endif
  4. ifndef BUILD_VERBOSE
  5. BUILD_VERBOSE = 0
  6. endif
  7. ifeq ($(BUILD_VERBOSE),1)
  8. quiet =
  9. Q =
  10. else
  11. quiet = quiet_
  12. Q = @
  13. endif
  14. export Q quiet BUILD_VERBOSE
  15. squote := '
  16. escsq = $(subst $(squote),'\$(squote)',$1)
  17. echo-cmd = $(if $($(quiet)cmd_$(1)), echo ' $(call escsq,$($(quiet)cmd_$(1)))';)
  18. cmd = @$(echo-cmd) $(cmd_$(1))
  19. quiet_cmd_asm_offsets_s = [ $@ ]
  20. cmd_asm_offsets_s = $(CC) $(CFLAGS) $(defs) -S $< -o $@
  21. asm-offsets.s: asm-offsets.c $(headers)
  22. $(call cmd,asm_offsets_s)
  23. CLEAN_FILES += asm-offsets.s
  24. quiet_cmd_asm_offsets_h = [ $@ ]
  25. cmd_asm_offsets_h = \
  26. (set -e; \
  27. echo "/* DO NOT MODIFY. THIS FILE WAS AUTO-GENERATED. */"; \
  28. echo "\#ifndef _ASM_OFFSETS_H_"; \
  29. echo "\#define _ASM_OFFSETS_H_"; \
  30. echo ""; \
  31. awk '/\.ascii \" \#define/{val=$$5; gsub("\\$$", "", val); print $$3" "$$4" "val}' $^; \
  32. echo ""; \
  33. echo "\#endif") > $@
  34. asm-offsets.h: asm-offsets.s
  35. $(call cmd,asm_offsets_h)
  36. CLEAN_FILES += asm-offests.h