A microsecond-level performance profiling library for gint.
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.

Makefile 747B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #! /usr/bin/make -f
  2. # libprof Makefile
  3. cflags := -m3 -mb -ffreestanding -nostdlib -fstrict-volatile-bitfields -Wall \
  4. -Wextra -Os -I .
  5. target ?= sh3eb-elf
  6. lib := libprof.a
  7. header := libprof.h
  8. prefix := $(shell $(target)-gcc -print-search-dirs | grep install \
  9. | sed 's/install: //')
  10. ifeq "$(prefix)" ""
  11. $(error "Cannot determine compiler install path")
  12. endif
  13. src := $(wildcard *.c)
  14. obj := $(src:%=build/%.o)
  15. # Rules
  16. all: $(lib)
  17. $(lib): $(obj)
  18. $(target)-ar rcs $@ $^
  19. build/%.c.o: %.c | build/
  20. $(target)-gcc -c $< -o $@ $(cflags)
  21. # Misc rules
  22. clean:
  23. @ rm -rf build
  24. distclean: clean
  25. @ rm -f $(lib)
  26. %/:
  27. mkdir -p $@
  28. .PRECIOUS: %/
  29. # Install
  30. install:
  31. cp $(lib) $(prefix)
  32. cp $(header) $(prefix)/include