premake/Bootstrap.mak

154 lines
5.4 KiB
Makefile
Raw Normal View History

2017-06-25 15:57:53 +00:00
MSDEV = vs2012
CONFIG = release
PLATFORM = x86
2017-06-25 15:57:53 +00:00
LUA_DIR = contrib/lua/src
LUASHIM_DIR = contrib/luashim
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 \
HOST_PLATFORM= none
.PHONY: default none clean nix-clean windows-clean \
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
default: $(HOST_PLATFORM)
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"
@echo "or"
@echo " make -f Bootstrap.mak HOST_PLATFORM"
@echo "where HOST_PLATFORM is one of these:"
@echo " osx linux bsd"
@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"
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
mingw-clean: windows-clean
mingw: mingw-clean
2018-07-19 20:55:59 +00:00
if not exist build\bootstrap (mkdir build\bootstrap)
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lole32 -lversion
./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
$(MAKE) -C build/bootstrap config=$(CONFIG)_$(PLATFORM)
macosx: osx
macosx-clean: osx-clean
osx-clean: nix-clean
osx: osx-clean
mkdir -p build/bootstrap
$(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)
./build/bootstrap/premake_bootstrap embed
2021-05-25 00:50:08 +00:00
./build/bootstrap/premake_bootstrap --arch=$(PLATFORM) --to=build/bootstrap gmake2
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
linux-clean: nix-clean
linux: linux-clean
mkdir -p build/bootstrap
$(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
./build/bootstrap/premake_bootstrap embed
2019-05-04 15:17:19 +00:00
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
bsd-clean: nix-clean
bsd: bsd-clean
2017-04-13 17:07:20 +00:00
mkdir -p build/bootstrap
$(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
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
2017-04-13 17:07:20 +00:00
solaris-clean: nix-clean
solaris: solaris-clean
mkdir -p build/bootstrap
$(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
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
2017-04-13 17:07:20 +00:00
haiku-clean: nix-clean
haiku: haiku-clean
mkdir -p build/bootstrap
$(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
./build/bootstrap/premake_bootstrap embed
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
windows-base: windows-clean
if not exist build\bootstrap (mkdir build\bootstrap)
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)
.\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
devenv .\build\bootstrap\Premake5.sln /Upgrade
devenv .\build\bootstrap\Premake5.sln /Build "$(CONFIG)|$(PLATFORM:x86=win32)"
2016-11-28 02:42:31 +00:00
windows-msbuild: windows-base
msbuild /p:Configuration=$(CONFIG) /p:Platform=$(PLATFORM:x86=win32) .\build\bootstrap\Premake5.sln