2010-11-15 21:51:38 +10:00
|
|
|
# VC makefile for ANSICON.
|
|
|
|
# Jason Hood, 15 November, 2010.
|
|
|
|
|
|
|
|
# I've used Visual C++ 2008 Express for the 32-bit version and the 2003 R2
|
|
|
|
# Platform SDK for the 64-bit version. Since these are entirely separate
|
|
|
|
# environments, define BITS to decide which should be built. Note that the
|
|
|
|
# 64-bit version still requires the 32-bit ANSI32.dll, so both environments
|
|
|
|
# are required and you should build the 32-bit version before the 64-bit.
|
|
|
|
|
|
|
|
#BITS = 32
|
|
|
|
#BITS = 64
|
|
|
|
|
|
|
|
!IFNDEF BITS
|
|
|
|
BITS = 32
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF $(BITS) == 32
|
|
|
|
DIR = x86
|
|
|
|
!ELSE
|
|
|
|
!IF $(BITS) == 64
|
|
|
|
DIR = x64
|
|
|
|
!ELSE
|
|
|
|
!ERROR BITS should be defined to 32 or 64.
|
|
|
|
!ENDIF
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
CC = cl
|
|
|
|
CFLAGS = /nologo /W3 /Ox /GF /D_CRT_SECURE_NO_WARNINGS
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
LIBS = advapi32.lib user32.lib
|
2010-11-15 21:51:38 +10:00
|
|
|
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
# This is required for the 2003 Platform SDK, but not for Visual Studio 2010.
|
|
|
|
#LIBS64 = bufferoverflowu.lib
|
|
|
|
|
|
|
|
X86OBJS = x86\proctype.obj x86\injdll32.obj x86\util.obj
|
|
|
|
X64OBJS = x64\proctype.obj x64\injdll64.obj x64\injdll32.obj x64\util.obj
|
2010-12-12 21:58:35 +10:00
|
|
|
|
2010-11-15 21:51:38 +10:00
|
|
|
{}.c{$(DIR)}.obj:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
|
|
|
{}.rc{$(DIR)}.res:
|
|
|
|
rc /fo$@ $<
|
|
|
|
|
|
|
|
all: ansicon$(BITS)
|
|
|
|
|
2012-04-10 15:39:58 +10:00
|
|
|
ansicon32: x86 x86\ansicon.exe x86\ANSI32.dll x64\ANSI32.dll
|
2010-11-15 21:51:38 +10:00
|
|
|
|
2012-04-10 15:39:58 +10:00
|
|
|
ansicon64: x64 x64\ansicon.exe x64\ANSI64.dll x64\ANSI-LLW.exe
|
2010-11-15 21:51:38 +10:00
|
|
|
|
|
|
|
x86:
|
|
|
|
mkdir x86
|
|
|
|
|
2010-12-12 21:58:35 +10:00
|
|
|
x86\ansicon.exe: x86\ansicon.obj $(X86OBJS) x86\ansicon.res
|
2010-11-15 21:51:38 +10:00
|
|
|
$(CC) /nologo /Fe$@ $** $(LIBS)
|
|
|
|
|
2010-12-12 21:58:35 +10:00
|
|
|
x86\ANSI32.dll: x86\ANSI.obj $(X86OBJS) x86\ansi.res
|
2010-11-15 21:51:38 +10:00
|
|
|
$(CC) /nologo /LD /Fe$@ $** $(LIBS)
|
|
|
|
|
|
|
|
x64:
|
|
|
|
mkdir x64
|
|
|
|
|
2010-12-12 21:58:35 +10:00
|
|
|
x64\ansicon.exe: x64\ansicon.obj $(X64OBJS) x64\ansicon.res
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
$(CC) /nologo /Fe$@ $** $(LIBS) $(LIBS64)
|
2010-11-15 21:51:38 +10:00
|
|
|
|
2010-12-12 21:58:35 +10:00
|
|
|
x64\ANSI64.dll: x64\ANSI.obj $(X64OBJS) x64\ansi.res
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
$(CC) /nologo /LD /Fe$@ $** $(LIBS) $(LIBS64)
|
2010-11-15 21:51:38 +10:00
|
|
|
|
2012-04-10 15:39:58 +10:00
|
|
|
x64\ANSI32.dll: x64\ANSI32.obj x64\proctype32.obj x86\injdll32.obj x86\util.obj x86\ansi.res
|
|
|
|
$(CC) /nologo /LD /Fe$@ $** $(LIBS)
|
2010-11-15 21:51:38 +10:00
|
|
|
|
|
|
|
x64\ANSI-LLW.exe: ANSI-LLW.c
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
$(CC) $(CFLAGS) /Fe$@ /Fo$*.obj $? $(LIBS64)
|
2010-11-15 21:51:38 +10:00
|
|
|
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
ansicon.c: ansicon.h version.h
|
|
|
|
ansicon.rc: version.h
|
|
|
|
ANSI.c: ansicon.h version.h
|
|
|
|
ANSI.rc: version.h
|
|
|
|
util.c: ansicon.h
|
2010-12-12 21:58:35 +10:00
|
|
|
injdll32.c: ansicon.h
|
|
|
|
injdll64.c: ansicon.h
|
|
|
|
proctype.c: ansicon.h
|
|
|
|
|
2012-04-10 15:39:58 +10:00
|
|
|
x64\ANSI32.obj: ANSI.c
|
|
|
|
$(CC) /DW32ON64 /c $(CFLAGS) /Fo$@ $?
|
|
|
|
x64\proctype32.obj: proctype.c
|
|
|
|
$(CC) /DW32ON64 /c $(CFLAGS) /Fo$@ $?
|
|
|
|
|
2010-11-15 21:51:38 +10:00
|
|
|
clean:
|
2010-12-12 21:58:35 +10:00
|
|
|
-del $(DIR)\*.obj $(DIR)\*.res $(DIR)\*.lib $(DIR)\*.exp
|