Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support compiling for windows via MSVC
- Add build system configuration for MSVC - Replace gcc-specific attributes/builtins with macros - Add dummy members to empty structs - Replace ranged case statements (... syntax) with explict enumeration - Replace variable-length arrays with constant-length - Add alternate declarations of DIP macros, which require different varargs syntax - Inline a couple of __func__ references with the actual name of the current function - host_generic_regs.c: use memset to initial RRegUniverse - tilegx: replace a couple instances of very strange syntax I don't fully understand - When defining host-specific macros, use _WIN32 and _WIN64 to additionally detect x86/x64 platforms (TODO: handle ARM windows)
- Loading branch information
Showing
31 changed files
with
848 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.so | ||
*.lib | ||
*.dll | ||
*.exe | ||
vex | ||
|
||
auxprogs/genoffsets | ||
|
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,50 @@ | ||
!include common.mk | ||
|
||
## | ||
## Step 1: A bunch of defines | ||
## | ||
|
||
!if "$(MULTIARCH)" == "1" | ||
LIB_OBJS = $(NORMAL_OBJS) $(MULTIARCH_OBJS) | ||
!else | ||
LIB_OBJS = $(NORMAL_OBJS) $(MULTIARCH_OBJS) | ||
!endif | ||
|
||
CC = cl | ||
CC_NATIVE = cl | ||
AR = lib | ||
RM = del /F | ||
|
||
STATIC_LIBRARY_FILE = libvex.lib | ||
DYNAMIC_LIBRARY_FILE = libvex.dll | ||
EXTRA_CLEAN_FILES = auxprogs/genoffsets.exe genoffsets.obj | ||
|
||
CCFLAGS = /Ipub /Ipriv $(EXTRA_CFLAGS) /O2 /wd4715 | ||
|
||
all: vex | ||
|
||
$(STATIC_LIBRARY_FILE): $(LIB_OBJS) | ||
$(AR) -OUT:libvex.lib $(LIB_OBJS) | ||
|
||
$(DYNAMIC_LIBRARY_FILE): $(LIB_OBJS) | ||
@echo "Currently, we don't build libvex.dll." | ||
@echo "Doing so would require assembling a list of export symbols." | ||
|
||
|
||
pub\libvex_guest_offsets.h: $(PUB_HEADERS) auxprogs/genoffsets.c | ||
$(CC_NATIVE) $(CCFLAGS) auxprogs\genoffsets.c \ | ||
/Fo:auxprogs\genoffsets.o /Fe:auxprogs\genoffsets.exe | ||
auxprogs\genoffsets.exe > pub\libvex_guest_offsets.h | ||
|
||
.SUFFIXES: .o .c | ||
.c.o: | ||
$(CC) /Fo:$@ -c $< $(CCFLAGS) | ||
|
||
scratch: clean all | ||
|
||
vex: $(STATIC_LIBRARY_FILE) $(DYNAMIC_LIBRARY_FILE) $(GEN_HEADERS:/=\) | ||
|
||
clean: | ||
$(RM) $(GEN_HEADERS:/=\) $(NORMAL_OBJS:/=\) $(SINGLEARCH_OBJS:/=\) $(MULTIARCH_OBJS:/=\) \ | ||
$(STATIC_LIBRARY_FILE:/=\) $(DYNAMIC_LIBRARY_FILE:/=\) \ | ||
$(EXTRA_CLEAN_FILES:/=\) |
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
Oops, something went wrong.