Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 'make' does not recompile when source file has been edited
  2. Cell grid[GRID_HEIGHT][GRID_WIDTH];
  3.        
  4. #define GRID_HEIGHT 10
  5. #define GRID_WIDTH 10
  6.        
  7. CC = gcc
  8. OBJECTS = main.o functions.o
  9.  
  10. Game of Life : $(OBJECTS)
  11.     $(CC) $(OBJECTS) -o Game of Life -lncurses
  12.  
  13. %.o : %.c
  14.     $(CC) -c $<
  15.        
  16. %.o : functions.h
  17.        
  18. %.o : %.c functions.h
  19.     $(CC) -c $< -o $@
  20.        
  21. CC = gcc
  22. OBJECTS = main.o functions.o
  23.  
  24. %.o : %.c
  25.     $(CC) -MD -c $<
  26.  
  27. -include $(OBJECTS:.o=.d)