2022-12-19 01:52:15 +00:00
|
|
|
MSDEV = vs2022
|
2018-04-09 12:02:05 +00:00
|
|
|
CONFIG = release
|
2022-12-19 01:52:15 +00:00
|
|
|
PLATFORM = x64
|
2017-06-25 15:57:53 +00:00
|
|
|
LUA_DIR = contrib/lua/src
|
|
|
|
LUASHIM_DIR = contrib/luashim
|
2015-06-06 01:56:39 +00:00
|
|
|
|
2016-02-26 16:23:27 +00:00
|
|
|
SRC = src/host/*.c \
|
|
|
|
$(LUA_DIR)/lapi.c \
|
|
|
|
$(LUA_DIR)/lbaselib.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lbitlib.c \
|
|
|
|
$(LUA_DIR)/lcode.c \
|
|
|
|
$(LUA_DIR)/lcorolib.c \
|
|
|
|
$(LUA_DIR)/lctype.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/ldblib.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/ldebug.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/ldo.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/ldump.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lfunc.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lgc.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/linit.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/liolib.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/llex.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lmathlib.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lmem.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/loadlib.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lobject.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lopcodes.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/loslib.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lparser.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lstate.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lstring.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lstrlib.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/ltable.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/ltablib.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/ltm.c \
|
2016-02-26 16:23:27 +00:00
|
|
|
$(LUA_DIR)/lundump.c \
|
2016-03-02 00:09:40 +00:00
|
|
|
$(LUA_DIR)/lutf8lib.c \
|
|
|
|
$(LUA_DIR)/lvm.c \
|
|
|
|
$(LUA_DIR)/lzio.c \
|
2015-06-06 01:56:39 +00:00
|
|
|
|
2018-04-09 12:02:05 +00:00
|
|
|
HOST_PLATFORM= none
|
2020-05-24 11:20:53 +00:00
|
|
|
|
2020-05-25 20:08:02 +00:00
|
|
|
.PHONY: default none clean nix-clean windows-clean \
|
2020-05-24 11:20:53 +00:00
|
|
|
mingw-clean mingw macosx macosx-clean osx-clean osx \
|
|
|
|
linux-clean linux bsd-clean bsd solaris-clean solaris \
|
|
|
|
haiku-clean haiku windows-base windows windows-msbuild
|
|
|
|
|
2018-04-09 12:02:05 +00:00
|
|
|
default: $(HOST_PLATFORM)
|
2015-06-06 01:56:39 +00:00
|
|
|
|
|
|
|
none:
|
|
|
|
@echo "Please do"
|
|
|
|
@echo " nmake -f Bootstrap.mak windows"
|
|
|
|
@echo "or"
|
2020-03-30 21:00:38 +00:00
|
|
|
@echo " CC=mingw32-gcc mingw32-make -f Bootstrap.mak mingw CONFIG=x64"
|
2015-06-11 18:11:50 +00:00
|
|
|
@echo "or"
|
|
|
|
@echo " make -f Bootstrap.mak HOST_PLATFORM"
|
|
|
|
@echo "where HOST_PLATFORM is one of these:"
|
2017-07-03 10:54:51 +00:00
|
|
|
@echo " osx linux bsd"
|
2020-05-25 20:08:02 +00:00
|
|
|
@echo ""
|
|
|
|
@echo "To clean the source tree, run the same command by adding a '-clean' suffix to the target name."
|
|
|
|
@echo "Example"
|
|
|
|
@echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Please run the same command used for building by adding a '-clean' suffix to the target name."
|
|
|
|
@echo " nmake -f Bootstrap.mak windows-clean"
|
|
|
|
@echo "or"
|
|
|
|
@echo " CC=mingw32-gcc mingw32-make -f Bootstrap.mak mingw-clean CONFIG=x64"
|
|
|
|
@echo "or"
|
|
|
|
@echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
|
|
|
|
@echo "where HOST_PLATFORM is one of these:"
|
|
|
|
@echo " osx linux bsd"
|
2015-06-06 01:56:39 +00:00
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
nix-clean:
|
|
|
|
$(SILENT) rm -rf ./bin
|
|
|
|
$(SILENT) rm -rf ./build
|
|
|
|
$(SILENT) rm -rf ./obj
|
|
|
|
|
|
|
|
windows-clean:
|
2018-07-19 20:55:59 +00:00
|
|
|
$(SILENT) if exist .\bin rmdir /s /q .\bin
|
|
|
|
$(SILENT) if exist .\build rmdir /s /q .\build
|
|
|
|
$(SILENT) if exist .\obj rmdir /s /q .\obj
|
2020-05-24 11:20:53 +00:00
|
|
|
|
2022-01-16 12:02:07 +00:00
|
|
|
mingw-clean: nix-clean
|
2020-05-24 11:20:53 +00:00
|
|
|
|
|
|
|
mingw: mingw-clean
|
2022-01-16 12:02:07 +00:00
|
|
|
mkdir -p build/bootstrap
|
2020-05-24 11:20:53 +00:00
|
|
|
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lole32 -lversion
|
2015-06-11 18:11:50 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
2021-05-25 00:50:08 +00:00
|
|
|
./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --os=windows --to=build/bootstrap --cc=mingw gmake2
|
2022-01-16 12:02:07 +00:00
|
|
|
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)_$(PLATFORM:x86=win32)
|
2015-06-11 18:11:50 +00:00
|
|
|
|
2019-05-03 15:35:04 +00:00
|
|
|
macosx: osx
|
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
macosx-clean: osx-clean
|
|
|
|
|
|
|
|
osx-clean: nix-clean
|
|
|
|
|
|
|
|
osx: osx-clean
|
2015-06-06 01:56:39 +00:00
|
|
|
mkdir -p build/bootstrap
|
2020-05-24 11:20:53 +00:00
|
|
|
$(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)
|
2015-06-06 01:56:39 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
2021-05-25 00:50:08 +00:00
|
|
|
./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap gmake2
|
2018-04-09 12:02:05 +00:00
|
|
|
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
2015-06-06 01:56:39 +00:00
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
linux-clean: nix-clean
|
|
|
|
|
|
|
|
linux: linux-clean
|
2015-06-06 01:56:39 +00:00
|
|
|
mkdir -p build/bootstrap
|
2022-04-28 23:50:31 +00:00
|
|
|
$(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 -luuid
|
2015-06-06 01:56:39 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
2019-05-04 15:17:19 +00:00
|
|
|
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
2018-04-09 12:02:05 +00:00
|
|
|
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
2015-06-06 01:56:39 +00:00
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
bsd-clean: nix-clean
|
|
|
|
|
|
|
|
bsd: bsd-clean
|
2017-04-13 17:07:20 +00:00
|
|
|
mkdir -p build/bootstrap
|
2020-05-24 11:20:53 +00:00
|
|
|
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
|
2017-04-13 17:07:20 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
2019-05-04 15:17:19 +00:00
|
|
|
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
2018-04-26 16:00:46 +00:00
|
|
|
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
|
2017-04-13 17:07:20 +00:00
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
solaris-clean: nix-clean
|
|
|
|
|
|
|
|
solaris: solaris-clean
|
2018-04-25 13:07:22 +00:00
|
|
|
mkdir -p build/bootstrap
|
2020-05-24 11:20:53 +00:00
|
|
|
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
|
2017-04-13 17:07:20 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
2019-05-04 15:17:19 +00:00
|
|
|
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
2018-04-25 20:35:58 +00:00
|
|
|
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
|
2017-04-13 17:07:20 +00:00
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
haiku-clean: nix-clean
|
|
|
|
|
|
|
|
haiku: haiku-clean
|
2019-05-18 17:11:35 +00:00
|
|
|
mkdir -p build/bootstrap
|
2020-05-24 11:20:53 +00:00
|
|
|
$(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
|
2019-05-18 17:11:35 +00:00
|
|
|
./build/bootstrap/premake_bootstrap embed
|
|
|
|
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
|
|
|
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
|
|
|
|
2020-05-24 11:20:53 +00:00
|
|
|
windows-base: windows-clean
|
2015-06-06 01:56:39 +00:00
|
|
|
if not exist build\bootstrap (mkdir build\bootstrap)
|
2020-05-24 11:20:53 +00:00
|
|
|
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)
|
2015-06-06 01:56:39 +00:00
|
|
|
.\build\bootstrap\premake_bootstrap.exe embed
|
2021-05-25 00:50:08 +00:00
|
|
|
.\build\bootstrap\premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap $(MSDEV)
|
2016-11-28 02:42:31 +00:00
|
|
|
|
|
|
|
windows: windows-base
|
2015-06-06 01:56:39 +00:00
|
|
|
devenv .\build\bootstrap\Premake5.sln /Upgrade
|
2018-04-09 12:02:05 +00:00
|
|
|
devenv .\build\bootstrap\Premake5.sln /Build "$(CONFIG)|$(PLATFORM:x86=win32)"
|
2016-11-28 02:42:31 +00:00
|
|
|
|
|
|
|
windows-msbuild: windows-base
|
2018-04-09 12:02:05 +00:00
|
|
|
msbuild /p:Configuration=$(CONFIG) /p:Platform=$(PLATFORM:x86=win32) .\build\bootstrap\Premake5.sln
|