1
0

Bootstrap.mak 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. MSDEV = vs2012
  2. CONFIG = release
  3. PLATFORM = x86
  4. LUA_DIR = contrib/lua/src
  5. LUASHIM_DIR = contrib/luashim
  6. SRC = src/host/*.c \
  7. $(LUA_DIR)/lapi.c \
  8. $(LUA_DIR)/lbaselib.c \
  9. $(LUA_DIR)/lbitlib.c \
  10. $(LUA_DIR)/lcode.c \
  11. $(LUA_DIR)/lcorolib.c \
  12. $(LUA_DIR)/lctype.c \
  13. $(LUA_DIR)/ldblib.c \
  14. $(LUA_DIR)/ldebug.c \
  15. $(LUA_DIR)/ldo.c \
  16. $(LUA_DIR)/ldump.c \
  17. $(LUA_DIR)/lfunc.c \
  18. $(LUA_DIR)/lgc.c \
  19. $(LUA_DIR)/linit.c \
  20. $(LUA_DIR)/liolib.c \
  21. $(LUA_DIR)/llex.c \
  22. $(LUA_DIR)/lmathlib.c \
  23. $(LUA_DIR)/lmem.c \
  24. $(LUA_DIR)/loadlib.c \
  25. $(LUA_DIR)/lobject.c \
  26. $(LUA_DIR)/lopcodes.c \
  27. $(LUA_DIR)/loslib.c \
  28. $(LUA_DIR)/lparser.c \
  29. $(LUA_DIR)/lstate.c \
  30. $(LUA_DIR)/lstring.c \
  31. $(LUA_DIR)/lstrlib.c \
  32. $(LUA_DIR)/ltable.c \
  33. $(LUA_DIR)/ltablib.c \
  34. $(LUA_DIR)/ltm.c \
  35. $(LUA_DIR)/lundump.c \
  36. $(LUA_DIR)/lutf8lib.c \
  37. $(LUA_DIR)/lvm.c \
  38. $(LUA_DIR)/lzio.c \
  39. HOST_PLATFORM= none
  40. .PHONY: default none clean nix-clean windows-clean \
  41. mingw-clean mingw macosx macosx-clean osx-clean osx \
  42. linux-clean linux bsd-clean bsd solaris-clean solaris \
  43. haiku-clean haiku windows-base windows windows-msbuild
  44. default: $(HOST_PLATFORM)
  45. none:
  46. @echo "Please do"
  47. @echo " nmake -f Bootstrap.mak windows"
  48. @echo "or"
  49. @echo " CC=mingw32-gcc mingw32-make -f Bootstrap.mak mingw CONFIG=x64"
  50. @echo "or"
  51. @echo " make -f Bootstrap.mak HOST_PLATFORM"
  52. @echo "where HOST_PLATFORM is one of these:"
  53. @echo " osx linux bsd"
  54. @echo ""
  55. @echo "To clean the source tree, run the same command by adding a '-clean' suffix to the target name."
  56. @echo "Example"
  57. @echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
  58. clean:
  59. @echo "Please run the same command used for building by adding a '-clean' suffix to the target name."
  60. @echo " nmake -f Bootstrap.mak windows-clean"
  61. @echo "or"
  62. @echo " CC=mingw32-gcc mingw32-make -f Bootstrap.mak mingw-clean CONFIG=x64"
  63. @echo "or"
  64. @echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
  65. @echo "where HOST_PLATFORM is one of these:"
  66. @echo " osx linux bsd"
  67. nix-clean:
  68. $(SILENT) rm -rf ./bin
  69. $(SILENT) rm -rf ./build
  70. $(SILENT) rm -rf ./obj
  71. windows-clean:
  72. $(SILENT) if exist .\bin rmdir /s /q .\bin
  73. $(SILENT) if exist .\build rmdir /s /q .\build
  74. $(SILENT) if exist .\obj rmdir /s /q .\obj
  75. mingw-clean: windows-clean
  76. mingw: mingw-clean
  77. if not exist build\bootstrap (mkdir build\bootstrap)
  78. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lole32 -lversion
  79. ./build/bootstrap/premake_bootstrap embed
  80. ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --os=windows --to=build/bootstrap --cc=mingw gmake2
  81. $(MAKE) -C build/bootstrap config=$(CONFIG)_$(PLATFORM)
  82. macosx: osx
  83. macosx-clean: osx-clean
  84. osx-clean: nix-clean
  85. osx: osx-clean
  86. mkdir -p build/bootstrap
  87. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_MACOSX -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" -framework CoreServices -framework Foundation -framework Security -lreadline $(SRC)
  88. ./build/bootstrap/premake_bootstrap embed
  89. ./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap gmake2
  90. $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
  91. linux-clean: nix-clean
  92. linux: linux-clean
  93. mkdir -p build/bootstrap
  94. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm -ldl -lrt
  95. ./build/bootstrap/premake_bootstrap embed
  96. ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
  97. $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
  98. bsd-clean: nix-clean
  99. bsd: bsd-clean
  100. mkdir -p build/bootstrap
  101. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
  102. ./build/bootstrap/premake_bootstrap embed
  103. ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
  104. $(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
  105. solaris-clean: nix-clean
  106. solaris: solaris-clean
  107. mkdir -p build/bootstrap
  108. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
  109. ./build/bootstrap/premake_bootstrap embed
  110. ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
  111. $(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
  112. haiku-clean: nix-clean
  113. haiku: haiku-clean
  114. mkdir -p build/bootstrap
  115. $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_BSD_SOURCE -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lbsd
  116. ./build/bootstrap/premake_bootstrap embed
  117. ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
  118. $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
  119. windows-base: windows-clean
  120. if not exist build\bootstrap (mkdir build\bootstrap)
  121. cl /Fo.\build\bootstrap\ /Fe.\build\bootstrap\premake_bootstrap.exe /DPREMAKE_NO_BUILTIN_SCRIPTS /I"$(LUA_DIR)" /I"$(LUASHIM_DIR)" user32.lib ole32.lib advapi32.lib $(SRC)
  122. .\build\bootstrap\premake_bootstrap.exe embed
  123. .\build\bootstrap\premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap $(MSDEV)
  124. windows: windows-base
  125. devenv .\build\bootstrap\Premake5.sln /Upgrade
  126. devenv .\build\bootstrap\Premake5.sln /Build "$(CONFIG)|$(PLATFORM:x86=win32)"
  127. windows-msbuild: windows-base
  128. msbuild /p:Configuration=$(CONFIG) /p:Platform=$(PLATFORM:x86=win32) .\build\bootstrap\Premake5.sln