code_junkie

makefiles - compile all c files at once

Nov 11th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. LIBS = -lkernel32 -luser32 -lgdi32 -lopengl32
  2. CFLAGS = -Wall
  3.  
  4. OBJ = 64bitmath.o
  5. monotone.o
  6. node_sort.o
  7. planesweep.o
  8. triangulate.o
  9. prim_combine.o
  10. welding.o
  11. test.o
  12. main.o
  13.  
  14. %.o : %.c
  15. gcc -c $(CFLAGS) $< -o $@
  16.  
  17. test: $(OBJ)
  18. gcc -o $@ $^ $(CFLAGS) $(LIBS)
  19.  
  20. LIBS = -lkernel32 -luser32 -lgdi32 -lopengl32
  21. CFLAGS = -Wall
  22.  
  23. # Should be equivalent to your list of C files, if you don't build selectively
  24. SRC=$(wildcard *.c)
  25.  
  26. test: $(SRC)
  27. gcc -o $@ $^ $(CFLAGS) $(LIBS)
Add Comment
Please, Sign In to add comment