code_junkie

makefiles CFLAGS

Nov 10th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #ifdef PACKET_LINK
  2. // This code will be ignored if PACKET_LINK is not defined
  3. do_packet_link_stuff();
  4. #endif
  5.  
  6. #ifdef LOW_POWER
  7. // This code will be ignored if LOW_POWER is not defined
  8. handle_powersaving_functions();
  9. #endif
  10.  
  11. $(CC) $(CFLAGS) ...some-more-arguments...
  12.  
  13. #ifdef PACKET_LINK
  14. /* whatever code here */
  15. #endif
  16.  
  17. gcc $(CFLAGS) source.c
  18.  
  19. .c.exe:
  20. commands: $(CC) $(CFLAGS) $<
  21.  
  22. .c.obj:
  23. commands: $(CC) $(CFLAGS) /c $<
  24.  
  25. .cpp.exe:
  26. commands: $(CXX) $(CXXFLAGS) $<
  27.  
  28. .cpp.obj:
  29. commands: $(CXX) $(CXXFLAGS) /c $<
Add Comment
Please, Sign In to add comment