mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-10 22:59:13 +00:00
Added a Makefile for x86 (commandline build). Using _vsnprintf when _MSC_VER is defined unconditionally, since the MSVC 2003 doesn't have vsnprintf.
git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@56 3b4be424-7ac5-41d7-8526-f4ddcb85d872
This commit is contained in:
parent
f1e141b751
commit
35a9c794b2
3 changed files with 43 additions and 3 deletions
|
@ -4,7 +4,7 @@ all: libcpuid.lib
|
|||
|
||||
ASM = ml64 /nologo
|
||||
CC = cl.exe /nologo /TC
|
||||
OPTFLAGS =
|
||||
OPTFLAGS = /MT
|
||||
DEFINES = /D "VERSION=\"0.1.0\""
|
||||
OBJECTS = masm-x64.obj asm-bits.obj cpuid_main.obj libcpuid_util.obj recog_amd.obj recog_intel.obj rdtsc.obj
|
||||
|
||||
|
@ -30,7 +30,7 @@ recog_intel.obj: recog_intel.c
|
|||
$(CC) $(OPTFLAGS) $(DEFINES) /c recog_intel.c
|
||||
|
||||
rdtsc.obj: rdtsc.c
|
||||
$(CC) $(OPTFLASG) $(DEFINES) /c rdtsc.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c rdtsc.c
|
||||
|
||||
clean:
|
||||
del *.obj libcpuid.lib
|
||||
|
|
40
libcpuid/Makefile.x86
Normal file
40
libcpuid/Makefile.x86
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Makefile for Win32
|
||||
#
|
||||
# This is required on machines with multiple versions of the Microsoft compiler
|
||||
#
|
||||
# E.g. if you have Visual Studio 2008 and compile libcpuid with it, the static lib
|
||||
# will not link in an executable, created through makefiles and MSVC 2003 (7.1).
|
||||
#
|
||||
# The solution is to use this custom makefile and compile libcpuid for MSVC 2003
|
||||
#
|
||||
|
||||
all: libcpuid.lib
|
||||
|
||||
CC = cl.exe /nologo /TC
|
||||
OPTFLAGS = /MT
|
||||
DEFINES = /D "VERSION=\"0.1.0\""
|
||||
OBJECTS = asm-bits.obj cpuid_main.obj libcpuid_util.obj recog_amd.obj recog_intel.obj rdtsc.obj
|
||||
|
||||
libcpuid.lib: $(OBJECTS)
|
||||
lib /nologo /out:libcpuid.lib $(OBJECTS)
|
||||
|
||||
asm-bits.obj: asm-bits.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c asm-bits.c
|
||||
|
||||
cpuid_main.obj: cpuid_main.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c cpuid_main.c
|
||||
|
||||
libcpuid_util.obj: libcpuid_util.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c libcpuid_util.c
|
||||
|
||||
recog_amd.obj: recog_amd.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c recog_amd.c
|
||||
|
||||
recog_intel.obj: recog_intel.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c recog_intel.c
|
||||
|
||||
rdtsc.obj: rdtsc.c
|
||||
$(CC) $(OPTFLAGS) $(DEFINES) /c rdtsc.c
|
||||
|
||||
clean:
|
||||
del *.obj libcpuid.lib
|
|
@ -48,7 +48,7 @@ static void default_warn(const char *msg)
|
|||
|
||||
libcpuid_warn_fn_t _warn_fun = default_warn;
|
||||
|
||||
#if defined(_MSC_VER) && defined(_M_AMD64)
|
||||
#if defined(_MSC_VER)
|
||||
# define vsnprintf _vsnprintf
|
||||
#endif
|
||||
void warnf(const char* format, ...)
|
||||
|
|
Loading…
Reference in a new issue