README.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. How to build on linux
  2. ---------------------
  3. Summary
  4. =======
  5. Currently this build system is centered around mock. mock is a build system used for Fedora, CentOS, and RHEL to build packages. The way it works is it installed a "chroot" (a separate root) with the needed build environment to compile the package. This provides a clean, consistent, and automated way of building software. And because we are "piggybacking" off of CentOS for our build roots we gain stability and long-term support of the build environment.
  6. The scripts in this directory will prepare a mock environment based on CentOS 6 (32bit and 64bit when Steam supports it). There is a certain order to run things. and some steps only need to be done the first time.
  7. Games build in this system have proven very stable and VERY portable across a wide variety of distributions.
  8. Initial Setup
  9. =============
  10. mock-prep.sh must be run initially to prepare the build root.. This sets up the core mock build environment and installs a couple of additional packages needed to build Amnesia: AMFP (or pretty much any game). Simply run this command to set it up
  11. ./mock-prep.sh 32 init
  12. - 32 is the arch to setup, valid options are 32 or 64
  13. - init simply says "remove any existing root and start from scratch"
  14. Syncing the code
  15. ================
  16. Since it is a separate environment that will be "chrooted" into (meaning it won't have access to the host system) we must either "mount" the code in the root or copy it into the root. There is a file named mock-sync.txt which defines the folders to copy in to build the code. And the script mock-sync.sh does the work for us.
  17. ./mock-sync.sh 32
  18. - again 32 is the arch.. 64 is also valid
  19. Preparing for building the code
  20. ===============================
  21. (this is about manually setting things up to build.. there is a build-linux.sh script that does all this for you)
  22. The initial setup of building the code is to setup the build dirs via cmake so we must shell into the chroot.
  23. ./mock-shell 32
  24. then we go into the synced code directory
  25. cd builddir/AmnesiaPig
  26. Now create our build folders and setup cmake
  27. mkdir build
  28. cd build
  29. cmake ../ -DCMAKE_BUILD_TYPE=Release -DUSE_SDL2=ON
  30. cd ..
  31. now we can exit the chroot.
  32. exit
  33. You'll see some output like this
  34. [mockbuild@LinuxBoxen build-setup]$ exit
  35. logout
  36. Finish: shell
  37. Finish: lock buildroot
  38. Building the code
  39. =================
  40. You can either build the code in the chroot manually by running "make" in the build-game or build-setup directories.
  41. (use -j# to speed up the build by doing simultaneous compiles.. e.g. make -j4)
  42. To more automate the build process I have included a "build-linux.sh" script that will build the game and extract out the binaries for you into the Release folder.