这是一个本人学习 csapp 的 learning 库
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.

33 lines
771 B

  1. #
  2. # Student makefile for Cache Lab
  3. # Note: requires a 64-bit x86-64 system
  4. #
  5. CC = gcc
  6. CFLAGS = -g -Wall -Werror -std=c99 -m64
  7. all: csim test-trans tracegen
  8. # Generate a handin tar file each time you compile
  9. -tar -cvf ${USER}-handin.tar csim.c trans.c
  10. csim: csim.c cachelab.c cachelab.h
  11. $(CC) $(CFLAGS) -o csim csim.c cachelab.c -lm
  12. test-trans: test-trans.c trans.o cachelab.c cachelab.h
  13. $(CC) $(CFLAGS) -o test-trans test-trans.c cachelab.c trans.o
  14. tracegen: tracegen.c trans.o cachelab.c
  15. $(CC) $(CFLAGS) -O0 -o tracegen tracegen.c trans.o cachelab.c
  16. trans.o: trans.c
  17. $(CC) $(CFLAGS) -O0 -c trans.c
  18. #
  19. # Clean the src dirctory
  20. #
  21. clean:
  22. rm -rf *.o
  23. rm -f *.tar
  24. rm -f csim
  25. rm -f test-trans tracegen
  26. rm -f trace.all trace.f*
  27. rm -f .csim_results .marker