# GNU Makefile for vispatch windows binaries using GCC (MinGW).
CC ?= gcc
WINDRES ?= windres
OBJECTS:= utilslib.o \
strlcat.o \
strlcpy.o \
vispatch.o \
vispatch.res
OPTIMIZATIONS= -O2
CFLAGS = -g -Wall -W -Wshadow -DWIN32_LEAN_AND_MEAN $(OPTIMIZATIONS)
LDFLAGS= -mconsole
all: vispatch.exe
.c.o:
$(CC) $(CFLAGS) -c $*.c
# the program name is vispatch.exe and "patch" keyword is red-flagged
# by Windows Vista and newer to trigger UAC for X86 applications.
# So we need a manifest to set requestedExecutionLevel as "asInvoker"
# and uiAccess as "false". Not needed for AMD64, but doesn't hurt,
# either.
vispatch.res: vispatch.rc vispatch.exe.manifest
$(WINDRES) -DWIN32_LEAN_AND_MEAN --output-format=coff -o $@ $<
vispatch.exe: $(OBJECTS)
$(CC) -o $@ $(OBJECTS) $(LDFLAGS)
clean:
rm -f *.o *.res *.d