GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — yquake2/Makefile at master · yquake2/yquake2 Expand file tree/ Copy pathMakefileMore file actions 1430 lines (1198 loc) · 37.7 KB / Copy pathMakefileFile metadata and controls1430 lines (1198 loc) · 37.7 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 # ------------------------------------------------------ # # Makefile for the "Yamagi Quake 2 Client" # # # # Just type "make" to compile the # # - Client (quake2) # # - Server (q2ded) # # - Quake II Game (baseq2) # # - Renderer libraries (gl1, gl3, soft) # # # # Base dependencies: # # - SDL 2 or SDL 3 # # - libGL # # - Vulkan headers # # # # Optional dependencies: # # - CURL # # - OpenAL # # # # Platforms: # # - FreeBSD # # - Linux # # - NetBSD # # - OpenBSD # # - OS X # # - Windows (MinGW) # # ------------------------------------------------------ # # Variables # --------- # ASAN # Builds with address sanitizer, includes DEBUG. # DEBUG # Builds a debug build, forces -O0 and adds debug symbols. # MINGW_CHOST # If you use mingw this can specify architecture. # Available values: # x86_64-w64-mingw32 -> indicates x86_64 # i686-w64-mingw32 -> indicates i386 # QUIET # If defined, "===> CC ..." lines are silenced. # SOURCE_DATE_EPOCH # For reproduceable builds, look here for details: # https://reproducible-builds.org/specs/source-date-epoch/ # If set, adds a BUILD_DATE define to CFLAGS. # UBSAN # Builds with undefined behavior sanitizer.includes DEBUG. # VERBOSE # Prints full compile, linker and misc commands. # WERR # Treat compiler warnings as errors. # If defined, -Werror is added to compiler flags. # ---------- # User configurable options # ------------------------- # WITH_CURL # Enables HTTP support through cURL. Used for # HTTP download. WITH_CURL:=yes # WITH_EXECINFO # Enables backtraces through execinfo on supported platforms. # Usefull to get some basic debug information when the game # crashes. WITH_EXECINFO:=yes # WITH_OPENAL # Enables the optional OpenAL sound system. # To use it your system needs libopenal.so.1 # or openal32.dll (we recommend openal-soft) # installed WITH_OPENAL:=yes # WITH_RPATH # Sets an RPATH to $ORIGIN/lib. It can be used to # inject custom libraries, e.g. a patches libSDL.so # or libopenal.so. Not supported on Windows. WITH_RPATH:=yes # WITH_SDL3 # When disabled SDL 2 is used instead of SDL 3. WITH_SDL3:=yes # WITH_SYSTEM_MINIZIP # When disabled, an included copy of minizip and miniz is used. WITH_SYSTEM_MINIZIP:=no # WITH_SYSTEMWIDE # Enable systemwide installation of game assets. WITH_SYSTEMWIDE:=no # WITH_SYSTEMDIR # This will set the default SYSTEMDIR, a non-empty string # would actually be used. On Windows normals slashes (/) # instead of backslashed (\) should be used! The string # MUST NOT be surrounded by quotation marks! WITH_SYSTEMDIR:="" # Enable XDG directories support WITH_XDG:=yes # OSX_APP # This will set the build options to create an MacOS .app-bundle. # The app-bundle itself will not be created, but the runtime paths # will be set to expect the game-data in *.app/ # Contents/Resources OSX_APP:=yes # CONFIG_FILE # This is an optional configuration file, it'll be used in # case of presence. CONFIG_FILE:=config.mk # PKG_CONFIG # Specify program that configures SDL3. # Needs to be overridable for cross-compilation. PKG_CONFIG ?= pkgconf # ---------- # In case of a configuration file being present, we'll just use it ifeq ($(wildcard $(CONFIG_FILE)), $(CONFIG_FILE)) include $(CONFIG_FILE) endif # ---------- # Normalize QUIET value to either "x" or "" ifdef QUIET override QUIET := "x" else override QUIET := "" endif # ---------- # Check if it's pkgconf or pkg-config. ifeq (, $(shell which $(PKG_CONFIG))) ifneq (, $(shell which pkgconf)) PKG_CONFIG:=pkgconf else PKG_CONFIG:=pkg-config endif endif # ---------- # Detect the OS, normalize some abiguous YQ2_OSTYPE strings. YQ2_OSTYPE ?= $(shell uname -s | sed -e 's/MINGW.*/Windows/' -e 's/Windows.*/Windows/') # Detect the architecture ifeq ($(YQ2_OSTYPE), Windows) ifdef MINGW_CHOST ifeq ($(MINGW_CHOST), x86_64-w64-mingw32) YQ2_ARCH ?= x86_64 else # i686-w64-mingw32 YQ2_ARCH ?= i386 endif else # windows, but MINGW_CHOST not defined YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/') endif # windows but MINGW_CHOST not defined else ifneq ($(YQ2_OSTYPE), Darwin) # Normalize some abiguous YQ2_ARCH strings YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/arm64/aarch64/' -e 's/^arm.*/arm/') else YQ2_ARCH ?= $(shell uname -m) endif endif # Detect the compiler ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) COMPILER := clang COMPILERVER := $(shell $(CC) -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/') else ifeq ($(shell $(CC) -v 2>&1 | grep -c -E "(gcc version|gcc-Version)"), 1) COMPILER := gcc COMPILERVER := $(shell $(CC) -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/') else COMPILER := unknown endif # ASAN includes DEBUG ifdef ASAN DEBUG=1 endif # UBSAN includes DEBUG ifdef UBSAN DEBUG=1 endif # ---------- # Set up build and bin output directories # Root dir names override BINROOT := override BUILDROOT := build ifdef DEBUG override BINDIR := $(BINROOT)debug override BUILDDIR := $(BUILDROOT)/debug else override BINDIR := $(BINROOT)release override BUILDDIR := $(BUILDROOT)/release endif # ---------- # Base CFLAGS. These may be overridden by the environment. # Highest supported optimizations are -O2, higher levels # will likely break this crappy code. ifdef DEBUG CFLAGS ?= -O0 -g -Wall -pipe -DDEBUG ifdef ASAN override CFLAGS += -fsanitize=address -DUSE_SANITIZER endif ifdef UBSAN override CFLAGS += -fsanitize=undefined -DUSE_SANITIZER endif else CFLAGS ?= -O2 -Wall -pipe -fomit-frame-pointer endif # Treat warnings as errors ifdef WERR override CFLAGS += -Werror endif # Always needed are: # -fno-strict-aliasing since the source doesn't comply # with strict aliasing rules and it's next to impossible # to get it there... # -fwrapv for defined integer wrapping. MSVC6 did this # and the game code requires it. # -fvisibility=hidden to keep symbols hidden. This is # mostly best practice and not really necessary. override CFLAGS += -fno-strict-aliasing -fwrapv -fvisibility=hidden # -MMD to generate header dependencies. Unsupported by # the Clang shipped with OS X. ifneq ($(YQ2_OSTYPE), Darwin) override CFLAGS += -MMD endif # OS X architecture. ifeq ($(YQ2_OSTYPE), Darwin) override CFLAGS += -arch $(YQ2_ARCH) endif # ---------- # ARM needs a sane minimum architecture. We need the `yield` # opcode, arm6k is the first iteration that supports it. arm6k # is also the first Raspberry PI generation and older hardware # is likely too slow to run the game. We're not enforcing the # minimum architecture, but if you're build for something older # like arm5 the `yield` opcode isn't compiled in and the game # (especially q2ded) will consume more CPU time than necessary. ifeq ($(YQ2_ARCH), arm) CFLAGS += -march=armv6k endif # ---------- # Switch of some annoying warnings. ifeq ($(COMPILER), clang) # -Wno-missing-braces because otherwise clang complains # about totally valid 'vec3_t bla = {0}' constructs. # -fno-common avoids linker warnings due # uninitialized global variables treated as "common". # On most platforms clang sets no-commom by default, # MacOS is a prominent exception. override CFLAGS += -Wno-missing-braces -fno-common else ifeq ($(COMPILER), gcc) # GCC 8.0 or higher. ifeq ($(shell test $(COMPILERVER) -ge 80000; echo $$?),0) # -Wno-format-truncation and -Wno-format-overflow # because GCC spams about 50 false positives. override CFLAGS += -Wno-format-truncation -Wno-format-overflow endif endif # ---------- # Defines the operating system and architecture override CFLAGS += -DYQ2OSTYPE=\"$(YQ2_OSTYPE)\" -DYQ2ARCH=\"$(YQ2_ARCH)\" # ---------- ifdef SOURCE_DATE_EPOCH override CFLAGS += -DBUILD_DATE=\"$(shell date --utc --date="@${SOURCE_DATE_EPOCH}" +"%b %_d %Y" | sed -e 's/ /\\ /g')\" endif # ---------- # Using the default x87 float math on 32bit x86 causes rounding trouble # -ffloat-store could work around that, but the better solution is to # just enforce SSE - every x86 CPU since Pentium3 supports that # and this should even improve the performance on old CPUs ifeq ($(YQ2_ARCH), i386) override CFLAGS += -msse -mfpmath=sse endif # Force SSE math on x86_64. All sane compilers should do this # anyway, just to protect us from broken Linux distros. ifeq ($(YQ2_ARCH), x86_64) override CFLAGS += -mfpmath=sse endif # Disable floating-point expression contraction. While this shouldn't be # a problem for C (only for C++) better be safe than sorry. See # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839 for details. ifeq ($(COMPILER), gcc) override CFLAGS += -ffp-contract=off endif # ---------- # Systemwide installation. ifeq ($(WITH_SYSTEMWIDE),yes) override CFLAGS += -DSYSTEMWIDE ifneq ($(WITH_SYSTEMDIR),"") override CFLAGS += -DSYSTEMDIR=\"$(WITH_SYSTEMDIR)\" endif endif # ---------- # We don't support encrypted ZIP files. ZIPCFLAGS := -DNOUNCRYPT # Just set IOAPI_NO_64 on everything that's not Linux or Windows, # otherwise minizip will use fopen64(), fseek64() and friends that # may be unavailable. This is - of course - not really correct, in # a better world we would set -DIOAPI_NO_64 to force everything to # fopen(), fseek() and so on and -D_FILE_OFFSET_BITS=64 to let the # libc headers do their work. Currently we can't do that because # Quake II uses nearly everywere int instead of off_t... # # This may have the side effect that ZIP files larger than 2GB are # unsupported. But I doubt that anyone has such large files, they # would likely hit other internal limits. ifneq ($(YQ2_OSTYPE),Windows) ifneq ($(YQ2_OSTYPE),Linux) ZIPCFLAGS += -DIOAPI_NO_64 endif endif # ---------- # Extra CFLAGS for SDL. ifeq ($(WITH_SDL3),yes) SDLCFLAGS := $(shell $(PKG_CONFIG) --cflags sdl3) SDLCFLAGS += -DUSE_SDL3 else SDLCFLAGS := $(shell sdl2-config --cflags) endif ifdef NO_SDL_GYRO SDLCFLAGS += -DNO_SDL_GYRO endif # ---------- # Base include path. ifeq ($(YQ2_OSTYPE),Linux) INCLUDE ?= -I/usr/include else ifeq ($(YQ2_OSTYPE),FreeBSD) INCLUDE ?= -I/usr/local/include else ifeq ($(YQ2_OSTYPE),NetBSD) INCLUDE ?= -I/usr/X11R7/include -I/usr/pkg/include else ifeq ($(YQ2_OSTYPE),OpenBSD) INCLUDE ?= -I/usr/local/include else ifeq ($(YQ2_OSTYPE),Windows) INCLUDE ?= -I/usr/include else ifeq ($(YQ2_OSTYPE),Darwin) INCLUDE ?= -I/usr/local/include -I/opt/homebrew/include endif # ---------- # Base LDFLAGS. This is just the library path. ifeq ($(YQ2_OSTYPE),Linux) LDFLAGS ?= -L/usr/lib else ifeq ($(YQ2_OSTYPE),FreeBSD) LDFLAGS ?= -L/usr/local/lib else ifeq ($(YQ2_OSTYPE),NetBSD) LDFLAGS ?= -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib else ifeq ($(YQ2_OSTYPE),OpenBSD) LDFLAGS ?= -L/usr/local/lib else ifeq ($(YQ2_OSTYPE),Windows) LDFLAGS ?= -L/usr/lib else ifeq ($(YQ2_OSTYPE),Darwin) LDFLAGS ?= -L/usr/local/lib -L/opt/homebrew/lib endif # Link address sanitizer if requested. ifdef ASAN override LDFLAGS += -fsanitize=address endif # Link undefined behavior sanitizer if requested. ifdef UBSAN override LDFLAGS += -fsanitize=undefined endif # Required libraries. ifeq ($(YQ2_OSTYPE),Linux) LDLIBS ?= -lm -ldl -rdynamic else ifeq ($(YQ2_OSTYPE),FreeBSD) LDLIBS ?= -lm else ifeq ($(YQ2_OSTYPE),NetBSD) LDLIBS ?= -lm else ifeq ($(YQ2_OSTYPE),OpenBSD) LDLIBS ?= -lm else ifeq ($(YQ2_OSTYPE),Windows) LDLIBS ?= -lws2_32 -lwinmm -static-libgcc else ifeq ($(YQ2_OSTYPE), Darwin) LDLIBS ?= -arch $(YQ2_ARCH) else ifeq ($(YQ2_OSTYPE), Haiku) LDLIBS ?= -lm -lnetwork else ifeq ($(YQ2_OSTYPE), SunOS) LDLIBS ?= -lm -lsocket -lnsl endif # ASAN and UBSAN must not be linked # with --no-undefined. OSX and OpenBSD # don't support it at all. ifndef ASAN ifndef UBSAN ifneq ($(YQ2_OSTYPE), Darwin) ifneq ($(YQ2_OSTYPE), OpenBSD) override LDFLAGS += -Wl,--no-undefined endif endif endif endif # ---------- # Extra LDFLAGS for SDL ifeq ($(WITH_SDL3),yes) ifeq ($(YQ2_OSTYPE), Darwin) SDLLDFLAGS := -lSDL3 else SDLLDFLAGS := $(shell $(PKG_CONFIG) --libs sdl3) endif else ifeq ($(YQ2_OSTYPE), Darwin) SDLLDFLAGS := -lSDL2 else SDLLDFLAGS := $(shell sdl2-config --libs) endif endif # The renderer libs don't need libSDL2main, libmingw32 or -mwindows. ifeq ($(YQ2_OSTYPE), Windows) DLL_SDLLDFLAGS = $(subst -mwindows,,$(subst -lmingw32,,$(subst -lSDL2main,,$(SDLLDFLAGS)))) endif # ---------- # When make is invoked by "make VERBOSE=1" print # the compiler and linker commands. ifdef VERBOSE Q := else Q := @ endif # ---------- # Phony targets .PHONY : all client game icon server ref_gl1 ref_gl3 ref_gles1 ref_gles3 ref_soft # ---------- # Builds everything but the GLES1 renderer all: config client server game ref_gl1 ref_gl3 ref_gles3 ref_soft # ---------- # Builds everything, including the GLES1 renderer with_gles1: all ref_gles1 # ---------- # Print config values config: @echo "Build configuration" @echo "============================" @echo "YQ2_ARCH = $(YQ2_ARCH), YQ2_OSTYPE = $(YQ2_OSTYPE), COMPILER = $(COMPILER)" @echo "WITH_CURL = $(WITH_CURL)" @echo "WITH_OPENAL = $(WITH_OPENAL)" @echo "WITH_RPATH = $(WITH_RPATH)" @echo "WITH_SDL3 = $(WITH_SDL3)" @echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)" @echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)" @echo "WITH_XDG = $(WITH_XDG)" @echo "============================" @echo "" # ---------- # Special target to compile the icon on Windows ifeq ($(YQ2_OSTYPE), Windows) icon: @echo "===> WR $(BUILDROOT)/icon/icon.res" ${Q}mkdir -p $(BUILDROOT)/icon ${Q}windres src/backends/windows/icon.rc -O COFF -o $(BUILDROOT)/icon/icon.res endif # ---------- # Cleanup clean: @echo "===> CLEAN" ${Q}rm -Rf build debug/* release/* cleanall: @echo "===> CLEAN" ${Q}rm -Rf build debug release # ---------- # The client ifeq ($(YQ2_OSTYPE), Windows) client: @echo "===> Building yquake2.exe" ${Q}mkdir -p $(BINDIR) $(MAKE) $(BINDIR)/yquake2.exe @echo "===> Building quake2.exe Wrapper" $(MAKE) $(BINDIR)/quake2.exe $(BUILDDIR)/client/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(ZIPCFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/yquake2.exe : LDFLAGS += -mwindows ifeq ($(WITH_CURL),yes) $(BINDIR)/yquake2.exe : CFLAGS += -DUSE_CURL endif ifeq ($(WITH_OPENAL),yes) $(BINDIR)/yquake2.exe : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"openal32.dll"' endif else # not Windows client: @echo "===> Building quake2" ${Q}mkdir -p $(BINDIR) $(MAKE) $(BINDIR)/quake2 ifeq ($(YQ2_OSTYPE), Darwin) $(BUILDDIR)/client/%.o : %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -arch $(YQ2_ARCH) -x objective-c -c $(CFLAGS) $(SDLCFLAGS) $(ZIPCFLAGS) $(INCLUDE) $< -o $@ else $(BUILDDIR)/client/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(ZIPCFLAGS) $(INCLUDE) -o $@ $< endif $(BINDIR)/quake2 : CFLAGS += -Wno-unused-result ifeq ($(WITH_CURL),yes) $(BINDIR)/quake2 : CFLAGS += -DUSE_CURL endif ifeq ($(WITH_OPENAL),yes) ifeq ($(YQ2_OSTYPE), OpenBSD) $(BINDIR)/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' else ifeq ($(YQ2_OSTYPE), Darwin) OPENAL_PATH ?= $(shell brew --prefix openal-soft) $(BINDIR)/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"' -I$(OPENAL_PATH)/include $(BINDIR)/quake2 : LDFLAGS += -L$(OPENAL_PATH)/lib -rpath $(OPENAL_PATH)/lib else $(BINDIR)/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' endif endif ifeq ($(WITH_EXECINFO),yes) ifeq ($(YQ2_OSTYPE), Linux) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO else ifeq ($(YQ2_OSTYPE), Darwin) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO else ifeq ($(YQ2_OSTYPE), SunOS) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO else ifeq ($(YQ2_OSTYPE), FreeBSD) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO $(BINDIR)/quake2 : LDLIBS += -lexecinfo else ifeq ($(YQ2_OSTYPE), NetBSD) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO $(BINDIR)/quake2 : LDLIBS += -lexecinfo else ifeq ($(YQ2_OSTYPE), OpenBSD) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO $(BINDIR)/quake2 : LDLIBS += -lexecinfo else ifeq ($(YQ2_OSTYPE), Haiku) $(BINDIR)/quake2 : CFLAGS += -DHAVE_EXECINFO $(BINDIR)/quake2 : LDLIBS += -lexecinfo endif endif ifeq ($(WITH_RPATH),yes) ifeq ($(YQ2_OSTYPE), Darwin) $(BINDIR)/quake2 : LDFLAGS += -Wl,-rpath,'@executable_path/lib' else $(BINDIR)/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib' endif endif endif ifeq ($(WITH_XDG),yes) $(BINDIR)/quake2 : CFLAGS += -DUSE_XDG endif # ---------- # The server ifeq ($(YQ2_OSTYPE), Windows) server: @echo "===> Building q2ded" ${Q}mkdir -p $(BINDIR) $(MAKE) $(BINDIR)/q2ded.exe $(BUILDDIR)/server/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(ZIPCFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/q2ded.exe : CFLAGS += -DDEDICATED_ONLY else # not Windows server: @echo "===> Building q2ded" ${Q}mkdir -p $(BINDIR) $(MAKE) $(BINDIR)/q2ded $(BUILDDIR)/server/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(ZIPCFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/q2ded : CFLAGS += -DDEDICATED_ONLY -Wno-unused-result ifeq ($(YQ2_OSTYPE), FreeBSD) $(BINDIR)/q2ded : LDLIBS += -lexecinfo endif ifeq ($(WITH_XDG),yes) $(BINDIR)/q2ded : CFLAGS += -DUSE_XDG endif endif # ---------- # The OpenGL 1.x renderer lib ifeq ($(YQ2_OSTYPE), Windows) ref_gl1: @echo "===> Building ref_gl1.dll" $(MAKE) $(BINDIR)/ref_gl1.dll $(BINDIR)/ref_gl1.dll : LDFLAGS += -shared $(BINDIR)/ref_gl1.dll : LDLIBS += -lopengl32 else ifeq ($(YQ2_OSTYPE), Darwin) ref_gl1: @echo "===> Building ref_gl1.dylib" $(MAKE) $(BINDIR)/ref_gl1.dylib $(BINDIR)/ref_gl1.dylib : LDFLAGS += -shared -framework OpenGL else # not Windows or Darwin ref_gl1: @echo "===> Building ref_gl1.so" $(MAKE) $(BINDIR)/ref_gl1.so $(BINDIR)/ref_gl1.so : CFLAGS += -fPIC $(BINDIR)/ref_gl1.so : LDFLAGS += -shared $(BINDIR)/ref_gl1.so : LDLIBS += -lGL endif # OS specific ref_gl1 stuff $(BUILDDIR)/ref_gl1/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) -o $@ $< # ---------- # The OpenGL ES 1.0 renderer lib ifeq ($(YQ2_OSTYPE), Windows) ref_gles1: @echo "===> Building ref_gles1.dll" $(MAKE) $(BINDIR)/ref_gles1.dll $(BINDIR)/ref_gles1.dll : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include $(BINDIR)/ref_gles1.dll : CFLAGS += -DYQ2_GL1_GLES $(BINDIR)/ref_gles1.dll : LDFLAGS += -shared else ifeq ($(YQ2_OSTYPE), Darwin) ref_gles1: @echo "===> Building ref_gles1.dylib" $(MAKE) $(BINDIR)/ref_gles1.dylib $(BINDIR)/ref_gles1.dylib : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include $(BINDIR)/ref_gles1.dylib : CFLAGS += -DYQ2_GL1_GLES $(BINDIR)/ref_gles1.dylib : LDFLAGS += -shared else # not Windows or Darwin ref_gles1: @echo "===> Building ref_gles1.so" $(MAKE) $(BINDIR)/ref_gles1.so $(BINDIR)/ref_gles1.so : GLAD_INCLUDE = -Isrc/client/refresh/gl1/glad-gles1/include $(BINDIR)/ref_gles1.so : CFLAGS += -DYQ2_GL1_GLES -fPIC $(BINDIR)/ref_gles1.so : LDFLAGS += -shared endif # OS specific ref_gles1 stuff $(BUILDDIR)/ref_gles1/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) $(GLAD_INCLUDE) -o $@ $< # ---------- # The OpenGL 3.x renderer lib ifeq ($(YQ2_OSTYPE), Windows) ref_gl3: @echo "===> Building ref_gl3.dll" $(MAKE) $(BINDIR)/ref_gl3.dll $(BINDIR)/ref_gl3.dll : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad/include $(BINDIR)/ref_gl3.dll : LDFLAGS += -shared else ifeq ($(YQ2_OSTYPE), Darwin) ref_gl3: @echo "===> Building ref_gl3.dylib" $(MAKE) $(BINDIR)/ref_gl3.dylib $(BINDIR)/ref_gl3.dylib : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad/include $(BINDIR)/ref_gl3.dylib : LDFLAGS += -shared else # not Windows or Darwin ref_gl3: @echo "===> Building ref_gl3.so" $(MAKE) $(BINDIR)/ref_gl3.so $(BINDIR)/ref_gl3.so : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad/include $(BINDIR)/ref_gl3.so : CFLAGS += -fPIC $(BINDIR)/ref_gl3.so : LDFLAGS += -shared endif # OS specific ref_gl3 stuff $(BUILDDIR)/ref_gl3/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) $(GLAD_INCLUDE) -o $@ $< # ---------- # The OpenGL ES 3.0 renderer lib ifeq ($(YQ2_OSTYPE), Windows) ref_gles3: @echo "===> Building ref_gles3.dll" $(MAKE) $(BINDIR)/ref_gles3.dll $(BINDIR)/ref_gles3.dll : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad-gles3/include # YQ2_GL3_GLES3 is for GLES3, DYQ2_GL3_GLES is for things that are identical # in both GLES3 and GLES2 (in case we ever support that) $(BINDIR)/ref_gles3.dll : CFLAGS += -DYQ2_GL3_GLES3 -DYQ2_GL3_GLES $(BINDIR)/ref_gles3.dll : LDFLAGS += -shared else ifeq ($(YQ2_OSTYPE), Darwin) ref_gles3: @echo "===> Building ref_gles3.dylib" $(MAKE) $(BINDIR)/ref_gles3.dylib $(BINDIR)/ref_gles3.dylib : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad-gles3/include # YQ2_GL3_GLES3 is for GLES3, DYQ2_GL3_GLES is for things that are identical # in both GLES3 and GLES2 (in case we ever support that) $(BINDIR)/ref_gles3.dylib : CFLAGS += -DYQ2_GL3_GLES3 -DYQ2_GL3_GLES $(BINDIR)/ref_gles3.dylib : LDFLAGS += -shared else # not Windows or Darwin ref_gles3: @echo "===> Building ref_gles3.so" $(MAKE) $(BINDIR)/ref_gles3.so $(BINDIR)/ref_gles3.so : GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad-gles3/include # YQ2_GL3_GLES3 is for GLES3, DYQ2_GL3_GLES is for things that are identical # in both GLES3 and GLES2 (in case we ever support that) $(BINDIR)/ref_gles3.so : CFLAGS += -DYQ2_GL3_GLES3 -DYQ2_GL3_GLES -fPIC $(BINDIR)/ref_gles3.so : LDFLAGS += -shared GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad-gles3/include endif # OS specific ref_gl3 stuff $(BUILDDIR)/ref_gles3/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) $(GLAD_INCLUDE) -o $@ $< # ---------- # The soft renderer lib ifeq ($(YQ2_OSTYPE), Windows) ref_soft: @echo "===> Building ref_soft.dll" $(MAKE) $(BINDIR)/ref_soft.dll $(BINDIR)/ref_soft.dll : LDFLAGS += -shared else ifeq ($(YQ2_OSTYPE), Darwin) ref_soft: @echo "===> Building ref_soft.dylib" $(MAKE) $(BINDIR)/ref_soft.dylib $(BINDIR)/ref_soft.dylib : LDFLAGS += -shared else # not Windows or Darwin ref_soft: @echo "===> Building ref_soft.so" $(MAKE) $(BINDIR)/ref_soft.so $(BINDIR)/ref_soft.so : CFLAGS += -fPIC $(BINDIR)/ref_soft.so : LDFLAGS += -shared endif # OS specific ref_soft stuff $(BUILDDIR)/ref_soft/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) -o $@ $< # ---------- # The baseq2 game ifeq ($(YQ2_OSTYPE), Windows) game: @echo "===> Building baseq2/game.dll" ${Q}mkdir -p $(BINDIR)/baseq2 $(MAKE) $(BINDIR)/baseq2/game.dll $(BUILDDIR)/baseq2/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/baseq2/game.dll : LDFLAGS += -shared else ifeq ($(YQ2_OSTYPE), Darwin) game: @echo "===> Building baseq2/game.dylib" ${Q}mkdir -p $(BINDIR)/baseq2 $(MAKE) $(BINDIR)/baseq2/game.dylib $(BUILDDIR)/baseq2/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/baseq2/game.dylib : CFLAGS += -fPIC $(BINDIR)/baseq2/game.dylib : LDFLAGS += -shared else # not Windows or Darwin game: @echo "===> Building baseq2/game.so" ${Q}mkdir -p $(BINDIR)/baseq2 $(MAKE) $(BINDIR)/baseq2/game.so $(BUILDDIR)/baseq2/%.o: %.c @if [ -z $(QUIET) ]; then\ echo "===> CC $<";\ fi ${Q}mkdir -p $(@D) ${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $< $(BINDIR)/baseq2/game.so : CFLAGS += -fPIC -Wno-unused-result $(BINDIR)/baseq2/game.so : LDFLAGS += -shared endif # ---------- # Used by the game GAME_OBJS_ = \ src/common/shared/flash.o \ src/common/shared/rand.o \ src/common/shared/shared.o \ src/game/g_ai.o \ src/game/g_chase.o \ src/game/g_cmds.o \ src/game/g_combat.o \ src/game/g_func.o \ src/game/g_items.o \ src/game/g_main.o \ src/game/g_misc.o \ src/game/g_monster.o \ src/game/g_phys.o \ src/game/g_spawn.o \ src/game/g_svcmds.o \ src/game/g_target.o \ src/game/g_trigger.o \ src/game/g_turret.o \ src/game/g_utils.o \ src/game/g_weapon.o \ src/game/monster/berserker/berserker.o \ src/game/monster/boss2/boss2.o \ src/game/monster/boss3/boss3.o \ src/game/monster/boss3/boss31.o \ src/game/monster/boss3/boss32.o \ src/game/monster/brain/brain.o \ src/game/monster/chick/chick.o \ src/game/monster/flipper/flipper.o \ src/game/monster/float/float.o \ src/game/monster/flyer/flyer.o \ src/game/monster/gladiator/gladiator.o \ src/game/monster/gunner/gunner.o \ src/game/monster/hover/hover.o \ src/game/monster/infantry/infantry.o \ src/game/monster/insane/insane.o \ src/game/monster/medic/medic.o \ src/game/monster/misc/move.o \ src/game/monster/mutant/mutant.o \ src/game/monster/parasite/parasite.o \ src/game/monster/soldier/soldier.o \ src/game/monster/supertank/supertank.o \ src/game/monster/tank/tank.o \ src/game/player/client.o \ src/game/player/hud.o \ src/game/player/trail.o \ src/game/player/view.o \ src/game/player/weapon.o \ src/game/savegame/savegame.o |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |