PageRenderTime 49ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/core/Makefile

https://github.com/Morgulas/gccg-dev
Makefile | 173 lines | 52 code | 39 blank | 82 comment | 0 complexity | 461ec209c7d45d96fdf600ff447da6a7 MD5 | raw file
  1. #####################################################################
  2. #
  3. # Configuration
  4. #
  5. #####################################################################
  6. # System identification string
  7. SYSTEM="`uname -m` `uname -s` build by `echo $$USER` `date +'%Y-%m-%d'`"
  8. # C++ compiler
  9. CXX=g++
  10. # C compiler
  11. CC=gcc
  12. # Linker
  13. LD=g++
  14. # Explicit location of sdl-config if not in $PATH.
  15. SDLCONFIG=sdl-config
  16. # Tracker address
  17. TRACKER=http://tracker.thepiratebay.org/announce
  18. # Set these if compiling with squirrel.
  19. #CFLAGS_SQUIRREL=-I../SQUIRREL2/include -D USE_SQUIRREL
  20. #LIBS_SQUIRREL=-lsquirrel -lsqstdlib -L../SQUIRREL2/lib
  21. #COMMON_SQUIRREL=tmp/parser_libsquirrel.o
  22. #####################################################################
  23. #
  24. # Definitions
  25. #
  26. #####################################################################
  27. DEFINES=-DPACKAGE=\"GCCG\" -DSYSTEM=\"$(SYSTEM)\" -DCCG_DATADIR=\".\" -DCCG_SAVEDIR=\"./save\" -DSTACK_TRACE
  28. #CFLAGS=-I./src/include -g -Wall `$(SDLCONFIG) --cflags` -O3 $(CFLAGS_SQUIRREL)
  29. CFLAGS=-I./src/include -g -Wall `$(SDLCONFIG) --cflags` $(CFLAGS_SQUIRREL)
  30. CXXFLAGS=-ftemplate-depth-30 $(CFLAGS)
  31. LIBS=`$(SDLCONFIG) --libs` -lSDL_net -lSDL_image -ljpeg -lSDL_ttf -lSDL_mixer $(LIBS_SQUIRREL)
  32. LIBS_TEXT=`$(SDLCONFIG) --libs` -lSDL_net -lSDL_mixer $(LIBS_SQUIRREL)
  33. COMMON=tmp/parser_libcards.o tmp/parser_libnet.o tmp/parser.o tmp/data_filedb.o tmp/parser_lib.o tmp/tools.o tmp/carddata.o tmp/xml_parser.o tmp/security.o tmp/data.o tmp/localization.o $(COMMON_SQUIRREL)
  34. CLIENT=tmp/client.o $(COMMON) tmp/driver.o tmp/game.o tmp/interpreter.o tmp/SDL_rotozoom.o
  35. SERVER=tmp/server.o $(COMMON)
  36. GCCG=tmp/gccg.o $(COMMON)
  37. CXXCMD=$(CXX) $(ARGS) $(DEFINES) $(CXXFLAGS) -c
  38. CCCMD=$(CC) $(ARGS) $(DEFINES) $(CFLAGS) -c
  39. #####################################################################
  40. #
  41. # Help
  42. #
  43. #####################################################################
  44. help:
  45. @echo
  46. @echo Usage:
  47. @echo
  48. @echo " make all - rebuild client and server binaries"
  49. @echo " make client - rebuild client binaries"
  50. @echo " make server - rebuild server binaries"
  51. @echo " make clean - clear backup and temporary files"
  52. @echo " make gccg - rebuild simple command line script interpreter"
  53. @echo
  54. #####################################################################
  55. #
  56. # Targets
  57. #
  58. #####################################################################
  59. all: client server
  60. client: ccg_text_client ccg_client
  61. server: ccg_server
  62. .PHONY: clean pkgclean official
  63. clean:
  64. rm -f tmp/*.o *~ */*~ */*/*~ */*/*/*~ sheet*.*
  65. ccg_text_client: $(CLIENT) tmp/text-driver.o tmp/game-text-version.o
  66. $(LD) -o ccg_text_client $(CLIENT) tmp/text-driver.o tmp/game-text-version.o $(LIBS_TEXT)
  67. ccg_client: $(CLIENT) tmp/sdl-driver.o tmp/game-sdl-version.o
  68. $(LD) -o ccg_client $(CLIENT) tmp/sdl-driver.o tmp/game-sdl-version.o $(LIBS)
  69. ccg_server: $(SERVER)
  70. $(LD) -o ccg_server $(SERVER) $(LIBS_TEXT)
  71. gccg: $(GCCG)
  72. $(LD) -o gccg $(GCCG) $(LIBS_TEXT)
  73. parse_stats: tmp/parse_stats.o $(COMMON)
  74. $(LD) -o parse_stats tmp/parse_stats.o $(COMMON) $(LIBS_TEXT)
  75. tmp/%.o: src/%.cpp src/include/*.h
  76. mkdir -p tmp
  77. $(CXXCMD) -o $@ $<
  78. tmp/game-text-version.o: src/game-draw.cpp
  79. $(CXXCMD) -D TEXT_VERSION -o tmp/game-text-version.o src/game-draw.cpp
  80. tmp/game-sdl-version.o: src/game-draw.cpp
  81. $(CXXCMD) -D SDL_VERSION -o tmp/game-sdl-version.o src/game-draw.cpp
  82. tmp/SDL_rotozoom.o: src/SDL_rotozoom.c
  83. $(CCCMD) -o tmp/SDL_rotozoom.o src/SDL_rotozoom.c
  84. # web:
  85. # rm -rf ./build/sites/gccg.sourceforge.net/
  86. # mkdir -p ./build/sites/gccg.sourceforge.net/
  87. # rm -f doc/gccg.sourceforge.net/*~
  88. # rsync --delete -ax doc/gccg.sourceforge.net/* ./build/sites/gccg.sourceforge.net/
  89. # mkdir -p ./build/sites/gccg.sourceforge.net/graphics/avatar
  90. # cp graphics/avatar/*.png ./build/sites/gccg.sourceforge.net/graphics/avatar
  91. # perl/svn_cleanup.pl ./build/sites/gccg.sourceforge.net/ > /dev/null
  92. # rm -rf ./build/sites/gccg.sourceforge.net/modules
  93. # mkdir -p ./build/sites/gccg.sourceforge.net/modules
  94. # cp ./build/mirrors/gccg.sourceforge.net/available.xml ./build/sites/gccg.sourceforge.net/modules/
  95. # cp ./build/mirrors/gccg.sourceforge.net/gccg-*.tgz ./build/sites/gccg.sourceforge.net/modules/
  96. # cp installer/gccg_install.zip ./build/sites/gccg.sourceforge.net/downloads
  97. # web-update:
  98. # rsync --delete -avx ./build/sites/gccg.sourceforge.net/ `./tools/user uid`,gccg@web.sf.net:htdocs
  99. # revision:
  100. # strip $(TARGETS)
  101. # ./gccg_package revision
  102. # mirrors:
  103. # ./gccg_package create_mirrors gccg.sourceforge.net www.derangedmonkey.com lotrtcgdb.com
  104. # rebuild:
  105. # strip $(TARGETS)
  106. # cp $(TARGETS) `tools/sys_module`
  107. # ./gccg_package b
  108. # nr-zip:
  109. # tools/make_zip nr
  110. # nr-torrent:
  111. # rm -rf build
  112. # mkdir build
  113. # rm -rf ../build/torrents/Gccg-Nr-`tools/make_zip --version nr`
  114. # unzip -d build ../build/torrents/Gccg-Nr-`tools/make_zip --version nr`.zip
  115. # mkdir -p ../build/torrents/
  116. # mv build/Gccg-Nr-* ../build/torrents/
  117. # btmakemetafile $(TRACKER) ../build/torrents/Gccg-Nr-`tools/make_zip --version nr`
  118. # rm -rf build
  119. # cp ../build/torrents/Gccg-Nr-`tools/make_zip --version nr`.torrent save
  120. # full-build:
  121. # $(MAKE) clean
  122. # rm -rf ../build/modules
  123. # $(MAKE) -j2 all
  124. # $(MAKE) rebuild
  125. # rm -rf ../build/torrents
  126. # $(MAKE) nr-zip
  127. # $(MAKE) nr-torrent
  128. # $(MAKE) mirrors
  129. # $(MAKE) web
  130. # update:
  131. # $(MAKE) rebuild
  132. # $(MAKE) mirrors
  133. # $(MAKE) web
  134. # $(MAKE) web-update