From e9aea7e095256a8f1049a96ac98fc8599584a0ee Mon Sep 17 00:00:00 2001 From: doug Date: Mon, 5 Dec 2011 05:01:00 +0000 Subject: [PATCH] Added the Windows manifest generation to the cli app as well. --- Makefile.win | 11 +++++++++++ cli/Makefile.inc | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index cbe70b6..1395fdb 100644 --- a/Makefile.win +++ b/Makefile.win @@ -2,4 +2,15 @@ # Use make -f Makefile.win to use this Makefile, which adds # the required library to the LDFLAGS. LDFLAGS += -lws2_32 + +# Because Windows does weird stuff with apps that have +# "patch" in their name, we have to embed a manifest +# file into any apps or they will want administrator +# privileges in order to run. +EXTRA_LINK_OBJECTS += cli/macrompatcher.res + +# Here's the rule to create the .res file... +%.res: %.rc + windres --input $< --output $@ --output-format=coff + include Makefile \ No newline at end of file diff --git a/cli/Makefile.inc b/cli/Makefile.inc index 096cbf4..122d9dd 100644 --- a/cli/Makefile.inc +++ b/cli/Makefile.inc @@ -6,9 +6,10 @@ ROMPATCHER_EXE := cli/macrompatcher cli_all: $(ROMPATCHER_EXE) cli_clean: rm -f $(ROMPATCHER_SRCS:%.c=%.o) + rm -f $(EXTRA_LINK_OBJECTS) rm -f $(ROMPATCHER_EXE) -$(ROMPATCHER_EXE): $(ROMPATCHER_SRCS:%.c=%.o) $(ROMLIB_A) - $(CC) $(CFLAGS) -o $@ $< $(ROMLIB_A) $(LDFLAGS) +$(ROMPATCHER_EXE): $(ROMPATCHER_SRCS:%.c=%.o) $(ROMLIB_A) $(EXTRA_LINK_OBJECTS) + $(CC) $(CFLAGS) -o $@ $< $(ROMLIB_A) $(EXTRA_LINK_OBJECTS) $(LDFLAGS) cli/%o: cli/%.c