-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new simplified build for windows targets
- Loading branch information
Showing
5 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
# this script is needed to inscribe metadata in the .exe files | ||
# targeting windows. it creates a .rs to be used when linking | ||
|
||
cat << EOF > zenroom.rc | ||
1 VERSIONINFO | ||
FILEVERSION 1,0,0,0 | ||
PRODUCTVERSION 1,0,0,0 | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "040904E4" | ||
BEGIN | ||
VALUE "CompanyName", "Dyne.org Foundation" | ||
VALUE "FileDescription", "Zenroom, cryptolang VM" | ||
VALUE "FileVersion", "`date +'%Y%m%d'`" | ||
VALUE "InternalName", "zenroom" | ||
VALUE "LegalCopyright", "Written and designed by Denis Roio <[email protected]>" | ||
VALUE "OriginalFilename", "zenroom.exe" | ||
VALUE "ProductName", "Zenroom" | ||
VALUE "ProductVersion", "3" | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x409, 1252 | ||
END | ||
END | ||
EOF | ||
|
||
if [ "$(which windres)" = "" ]; then | ||
x86_64-w64-mingw32-windres zenroom.rc -O coff -o zenroom.res | ||
else | ||
windres zenroom.rc -O coff -o zenroom.res | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
## Initialize build defaults | ||
include build/init.mk | ||
|
||
BUILD_DEPS += mimalloc | ||
|
||
cc := $(shell which x86_64-w64-mingw32-gcc) | ||
ar := $(shell which x86_64-w64-mingw32-ar) | ||
ranlib := $(shell which x86_64-w64-mingw32-ranlib) | ||
ld := $(shell which x86_64-w64-mingw32-ld) | ||
system := Windows | ||
cflags += -mthreads ${defines} -D'ARCH="WIN"' -DARCH_WIN -DLUA_USE_WINDOWS -DLIBRARY | ||
ldflags += -L/usr/x86_64-w64-mingw32/lib -shared | ||
ldadd += -l:libm.a -l:libpthread.a -lssp -Wl,--out-implib,libzenroom_dll.lib | ||
|
||
## Specific compiler settings for all built dependencies | ||
ifdef RELEASE | ||
cflags += -O3 ${cflags_protection} -fPIC | ||
else | ||
cflags += ${cflags_debug} -fPIC | ||
endif | ||
ifdef CCACHE | ||
milagro_cmake_flags += -DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
mimalloc_cmake_flags += -DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
mimalloc_cmake_flags += -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
zenroom_cc := ccache ${cc} | ||
quantum_proof_cc := ccache ${cc} | ||
ed25519_cc := ccache ${cc} | ||
libcc_cc := ccache ${cc} | ||
lua_cc := ccache ${cc} | ||
endif | ||
|
||
|
||
all: ${BUILD_DEPS} stamp-exe-windres zenroom.dll | ||
|
||
stamp-exe-windres: | ||
sh build/stamp-exe.sh | ||
|
||
zenroom.dll: ${ZEN_SOURCES} | ||
$(info === Linking Windows zenroom.dll) | ||
${cc} ${cflags} ${ZEN_SOURCES} \ | ||
-o $@ zenroom.res ${ldflags} ${ldadd} | ||
|
||
include build/deps.mk | ||
|
||
|
||
# win-dll: ${BUILDS} | ||
# CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \ | ||
# make -C src win-dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## Initialize build defaults | ||
include build/init.mk | ||
|
||
BUILD_DEPS += mimalloc | ||
|
||
cc := $(shell which x86_64-w64-mingw32-gcc) | ||
ar := $(shell which x86_64-w64-mingw32-ar) | ||
ranlib := $(shell which x86_64-w64-mingw32-ranlib) | ||
ld := $(shell which x86_64-w64-mingw32-ld) | ||
system := Windows | ||
cflags += -mthreads ${defines} -D'ARCH="WIN"' -DARCH_WIN -DLUA_USE_WINDOWS | ||
ldflags += -L/usr/x86_64-w64-mingw32/lib | ||
ldadd += -l:libm.a -l:libpthread.a -lssp | ||
|
||
## Specific compiler settings for all built dependencies | ||
ifdef RELEASE | ||
cflags += -O3 ${cflags_protection} -fPIC | ||
else | ||
cflags += ${cflags_debug} -fPIC | ||
endif | ||
ifdef CCACHE | ||
milagro_cmake_flags += -DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
mimalloc_cmake_flags += -DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
mimalloc_cmake_flags += -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
zenroom_cc := ccache ${cc} | ||
quantum_proof_cc := ccache ${cc} | ||
ed25519_cc := ccache ${cc} | ||
libcc_cc := ccache ${cc} | ||
lua_cc := ccache ${cc} | ||
endif | ||
|
||
|
||
all: ${BUILD_DEPS} stamp-exe-windres zenroom.exe zencode-exec.exe | ||
|
||
stamp-exe-windres: | ||
sh build/stamp-exe.sh | ||
|
||
zenroom.exe: ${ZEN_SOURCES} src/cli-zenroom.o | ||
$(info === Linking Windows zenroom.exe) | ||
${cc} ${cflags} ${ZEN_SOURCES} src/cli-zenroom.o \ | ||
-o $@ zenroom.res ${ldflags} ${ldadd} | ||
|
||
zencode-exec.exe: ${ZEN_SOURCES} src/zencode-exec.o | ||
$(info === Linking Windows zencode-exec.exe) | ||
${cc} ${cflags} ${ZEN_SOURCES} src/zencode-exec.o \ | ||
-o $@ zenroom.res ${ldflags} ${ldadd} | ||
|
||
include build/deps.mk | ||
|
||
|
||
# win-dll: ${BUILDS} | ||
# CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \ | ||
# make -C src win-dll |