Guest User

Untitled

a guest
Jul 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. prog:=StudentList
  2. objs:=$(patsubst %.c,%.o,$(wildcard *.c))
  3.  
  4. cc:=gcc
  5. ccflags:=-MMD -g -Wall
  6. ldflags:=
  7.  
  8. test:=./$(prog)
  9.  
  10. %.o: %.c
  11. $(cc) $(ccflags) -c $<
  12.  
  13. $(prog): $(objs)
  14. $(cc) $(ccflags) -o $@ $^ $(ldflags)
  15.  
  16. .PHONY: clean test
  17.  
  18. clean:
  19. rm -f *.[od] $(prog)
  20.  
  21. test: $(prog)
  22. $(test)
  23.  
  24. leakcheck: $(prog)
  25. valgrind --leak-check=yes $(prog)
  26.  
  27. -include *.d
Add Comment
Please, Sign In to add comment