summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-01-31 22:24:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-01-31 22:24:26 -0800
commit5431f3f9ab2f41df5f702f31b19a27e5061fd730 (patch)
tree899dd65a9ab78cad4bbf7ab1085d2bfcf7995a0e /Makefile
parent9bb7ffe3ee931bbfebe38fec4f2b24d1b851aece (diff)
downloadtxr-5431f3f9ab2f41df5f702f31b19a27e5061fd730.tar.gz
txr-5431f3f9ab2f41df5f702f31b19a27e5061fd730.tar.bz2
txr-5431f3f9ab2f41df5f702f31b19a27e5061fd730.zip
On Windows, add icon and identifying meta-data to executable.
* Makefile (EXTRA_OBJS-y): New variable. (WINDRES): New recipe. * configure: Check for presence of windres, and generate add_win_res variable in config.make. * win/txr.xcf: New file: GIMP project for icon. * win/txr.ico: New file: icon with three sizes generated from GIMP project. * win/txr.rc: New file.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 17 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8cea7f4f..48a36fa5 100644
--- a/Makefile
+++ b/Makefile
@@ -41,12 +41,15 @@ ADD_CONF = $(addprefix $(1)/,$(2))
EACH_CONF = $(foreach conf,opt dbg,$(call ADD_CONF,$(conf),$(1)))
OBJS-y := # make sure OBJ-y is a value variable, not a macro variable
+EXTRA_OBJS-y :=
+
OBJS := txr.o lex.yy.o y.tab.o match.o lib.o regex.o gc.o unwind.o stream.o
OBJS += arith.o hash.o utf8.o filter.o eval.o rand.o combi.o sysif.o
OBJS-$(debug_support) += debug.o
OBJS-$(have_syslog) += syslog.o
OBJS-$(have_glob) += glob.o
OBJS-$(have_posix_sigs) += signal.o
+EXTRA_OBJS-$(add_win_res) += win/txr.res
ifneq ($(have_git),)
SRCS := $(addprefix $(top_srcdir)/,\
@@ -102,12 +105,24 @@ $(call ABBREV,LINK)
$(V)$(CC) $(1) $(CFLAGS) -o $@ $^ -lm
endef
+define WINDRES
+$(call ABBREV,RES)
+$(V)mkdir -p $(dir $@)
+$(V)windres -O coff -DTXR_VER=$(txr_ver) $< $@
+endef
+
dbg/%.o: %.c
$(call COMPILE_C_WITH_DEPS,)
opt/%.o: %.c
$(call COMPILE_C_WITH_DEPS,$(OPT_FLAGS))
+opt/%.res: win/%.rc
+ $(call WINDRES)
+
+%.res: %.rc
+ $(call WINDRES)
+
# The following pattern rule is used for test targets built by configure
%.o: %.c
$(call COMPILE_C)
@@ -122,10 +137,10 @@ endif
.PHONY: all
all: $(BUILD_TARGETS)
-$(PROG): $(OPT_OBJS)
+$(PROG): $(OPT_OBJS) $(EXTRA_OBJS-y)
$(call LINK_PROG,$(OPT_FLAGS))
-$(PROG)-dbg: $(DBG_OBJS)
+$(PROG)-dbg: $(DBG_OBJS) $(EXTRA_OBJS-y)
$(call LINK_PROG,)
VPATH := $(top_srcdir)