
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.
76 lines
1.8 KiB
Makefile
76 lines
1.8 KiB
Makefile
# Makefile for ANSICON.
|
|
# Jason Hood, 11 March, 2006. Updated 20 June, 2009.
|
|
|
|
# I've used TDM64 (gcc 4.6.1), building the 32-bit version in the x86 directory
|
|
# and the 64-bit version in the x64 directory. MinGW32 (gcc 3.4.5) will also
|
|
# build the 32-bit version.
|
|
|
|
# 19 November, 2010:
|
|
# explicitly use 64-bit flags, in case the compiler isn't.
|
|
#
|
|
# 13 December, 2011:
|
|
# use CMD for file operations, not programs from fileutils.
|
|
|
|
CC = gcc
|
|
CFLAGS = -O2 -Wall
|
|
|
|
X86OBJS = x86/proctype.o x86/injdll32.o x86/util.o
|
|
X64OBJS = x64/proctype.o x64/injdll64.o x64/injdll32.o x64/util.o
|
|
|
|
x86/%.o: %.c ansicon.h
|
|
$(CC) -m32 -c $(CFLAGS) $< -o $@
|
|
|
|
x86/%v.o: %.rc version.h
|
|
windres -U _WIN64 -F pe-i386 $< $@
|
|
|
|
x64/%.o: %.c ansicon.h
|
|
$(CC) -m64 -c $(CFLAGS) $< -o $@
|
|
|
|
x64/%v.o: %.rc version.h
|
|
windres -F pe-x86-64 $< $@
|
|
|
|
all: ansicon32 ansicon64
|
|
|
|
ansicon32: x86 x86/ansicon.exe x86/ANSI32.dll
|
|
|
|
ansicon64: x64 x64/ansicon.exe x64/ANSI64.dll x64/ANSI32.dll x64/ANSI-LLW.exe
|
|
|
|
x86:
|
|
cmd /c "mkdir x86"
|
|
|
|
x86/ansicon.exe: x86/ansicon.o $(X86OBJS) x86/ansiconv.o
|
|
$(CC) -m32 $+ -s -o $@
|
|
|
|
x86/ANSI32.dll: x86/ANSI.o $(X86OBJS) x86/ansiv.o
|
|
$(CC) -m32 $+ -s -o $@ -mdll -Wl,-shared
|
|
|
|
x64:
|
|
cmd /c "mkdir x64"
|
|
|
|
x64/ansicon.exe: x64/ansicon.o $(X64OBJS) x64/ansiconv.o
|
|
$(CC) -m64 $+ -s -o $@
|
|
|
|
x64/ANSI64.dll: x64/ANSI.o $(X64OBJS) x64/ansiv.o
|
|
$(CC) -m64 $+ -s -o $@ -mdll -Wl,-shared
|
|
|
|
x64/ANSI32.dll: x86/ANSI32.dll
|
|
cmd /c "copy/y x86\ANSI32.dll x64\ANSI32.dll >nul"
|
|
|
|
x64/ANSI-LLW.exe: ANSI-LLW.c
|
|
$(CC) -m32 $(CFLAGS) $< -s -o $@
|
|
|
|
x86/ansicon.o: version.h
|
|
x86/ANSI.o: version.h
|
|
x64/ansicon.o: version.h
|
|
x64/ANSI.o: version.h
|
|
x86/ansiconv.o: ansicon.rc
|
|
x86/ansiv.o: ansi.rc
|
|
x64/ansiconv.o: ansicon.rc
|
|
x64/ansiv.o: ansi.rc
|
|
|
|
# Need two commands, because if the directory doesn't exist, it won't delete
|
|
# anything at all.
|
|
clean:
|
|
-cmd /c "del x86\*.o 2>nul"
|
|
-cmd /c "del x64\*.o 2>nul"
|