22

Makefile

  1. APP=poker
  2.  
  3. ALL=$(LIBS) $(TEST) $(APP)
  4.  
  5. APP_SRCS=poker.cpp
  6. APP_OBJS=$(APP_SRCS:.cpp=.o)
  7.  
  8. APPLIB=poker.lib
  9.  
  10. APPLIB_SRCS=Card.cpp Hand.cpp Deck.cpp
  11. APPLIB_OBJS=$(APPLIB_SRCS:.cpp=.o)
  12.  
  13. TEST=tdeck thand tcard # in this order
  14.  
  15. CPP=g++
  16. CPPFLAGS=-DDEBUG -g
  17.  
  18. AR=ar -cr
  19.  
  20. all:    $(ALL)
  21. app:    $(APP)
  22. lib:    $(APPLIB)
  23. test:   $(TEST)
  24.  
  25. $(APPLIB):  $(APPLIB_OBJS)
  26.     $(AR) $@ $(APPLIB_OBJS)
  27.  
  28. $(APP):     $(APP_OBJS) $(APPLIB)
  29.     $(CPP) $(CPPFLAGS) $(APP_OBJS) $(APPLIB) -o $@
  30.    
  31. tcard:  Card.h Card.cpp
  32.     $(CPP) $(CPPFLAGS) -DSTANDALONE -DDEBUG Card.cpp -o $@
  33.  
  34. thand:  Hand.h Hand.cpp Card.o
  35.     $(CPP) $(CPPFLAGS) -DSTANDALONE -DDEBUG Hand.cpp Card.o -o $@
  36.    
  37. tdeck:  Deck.h Deck.cpp Hand.o Card.o
  38.     $(CPP) $(CPPFLAGS) -DSTANDALONE -DDEBUG Deck.cpp Hand.o Card.o -o $@
  39.  
  40. Card.o: Card.h
  41. Hand.o: Hand.h
  42. Deck.obj:   Deck.h
  43.  
  44. .PHONY: clean wipe
  45.  
  46. clean:
  47.     rm -f $(APP_OBJS) $(APPLIB_OBJS)
  48.     rm -f $(TEST)
  49.  
  50. wipe:   clean
  51.     rm -f $(APP) $(APPLIB)

Comments

Your comment:
[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 2000

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].