makefile 462 B

12345678910111213141516171819
  1. CFLAGS ?= -g -O3
  2. a.out: *.c *.h function_list test_list test_name_list
  3. ${CC} ${CFLAGS} *.c
  4. function_list: *.c
  5. grep -h "^[^ #].*) {" *.c |sed 's/ {.*/;/' > function_list
  6. test_list: *.c
  7. grep -h "^\s*void test_" *.c |sed 's/^\s*void \(.*\)(void) {.*/\1,/' > test_list
  8. test_name_list: *.c
  9. grep -h "^\s*void test_" *.c |sed 's/^\s*void \(.*\)(void) {.*/"\1",/' > test_name_list
  10. .PHONY: clean
  11. clean:
  12. -rm -rf a.out* function_list test_list test_name_list