summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-02-07 19:25:23 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-02-07 19:25:23 -0800
commitcbd2937606577580931b1de05bd18bf10de736ca (patch)
tree0fc6e2dc181dad1648183336d4446b9c275b1372
parentd4ec31236a52767f48b1acff7b5b12987e4054ed (diff)
downloadtxr-cbd2937606577580931b1de05bd18bf10de736ca.tar.gz
txr-cbd2937606577580931b1de05bd18bf10de736ca.tar.bz2
txr-cbd2937606577580931b1de05bd18bf10de736ca.zip
Support txr-win.exe target which has no console window.
* Makefile (EACH_CONF): Iterate over arguments. (opt/txr-win.o, dbg/txr-win.o): New special object files. (opt/%-win.o, dbg/%-win.o): New pattern rule to build special object files. ($(PROG)-win, $(PROG)-win-dbg): New program targets. * inst.nsi: Install txr-win.exe.
-rw-r--r--ChangeLog12
-rw-r--r--Makefile29
-rw-r--r--inst.nsi1
3 files changed, 37 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5c57bb38..18a993c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2015-02-07 Kaz Kylheku <kaz@kylheku.com>
+ Support txr-win.exe target which has no console window.
+
+ * Makefile (EACH_CONF): Iterate over arguments.
+ (opt/txr-win.o, dbg/txr-win.o): New special object files.
+ (opt/%-win.o, dbg/%-win.o): New pattern rule to build special object
+ files.
+ ($(PROG)-win, $(PROG)-win-dbg): New program targets.
+
+ * inst.nsi: Install txr-win.exe.
+
+2015-02-07 Kaz Kylheku <kaz@kylheku.com>
+
* txr.1: fixed flurry of phrasing, formatting fumbles.
2015-02-07 Kaz Kylheku <kaz@kylheku.com>
diff --git a/Makefile b/Makefile
index 48a36fa5..8cdf0309 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,8 @@ endif
# TXR objects
ADD_CONF = $(addprefix $(1)/,$(2))
-EACH_CONF = $(foreach conf,opt dbg,$(call ADD_CONF,$(conf),$(1)))
+EACH_CONF = $(foreach conf,opt dbg,\
+ $(foreach tgt,$(1),$(call ADD_CONF,$(conf),$(tgt))))
OBJS-y := # make sure OBJ-y is a value variable, not a macro variable
EXTRA_OBJS-y :=
@@ -117,6 +118,12 @@ dbg/%.o: %.c
opt/%.o: %.c
$(call COMPILE_C_WITH_DEPS,$(OPT_FLAGS))
+dbg/%-win.o: %.c
+ $(call COMPILE_C_WITH_DEPS,-DCONFIG_WIN_MAIN=1)
+
+opt/%-win.o: %.c
+ $(call COMPILE_C_WITH_DEPS,-DCONFIG_WIN_MAIN=1 $(OPT_FLAGS))
+
opt/%.res: win/%.rc
$(call WINDRES)
@@ -143,6 +150,12 @@ $(PROG): $(OPT_OBJS) $(EXTRA_OBJS-y)
$(PROG)-dbg: $(DBG_OBJS) $(EXTRA_OBJS-y)
$(call LINK_PROG,)
+$(PROG)-win: $(patsubst %/txr.o,%/txr-win.o,$(OPT_OBJS)) $(EXTRA_OBJS-y)
+ $(call LINK_PROG,-mwindows $(OPT_FLAGS))
+
+$(PROG)-win-dbg: $(patsubst %/txr.o,%/txr-win.o,$(DBG_OBJS)) $(EXTRA_OBJS-y)
+ $(call LINK_PROG,-mwindows)
+
VPATH := $(top_srcdir)
# Newline constant
@@ -193,10 +206,16 @@ $(call EACH_CONF,y.tab.o): CFLAGS += -Dlint
# txr.c needs to know the relative datadir path to do some sysroot
# calculations.
-opt/txr.o: CFLAGS += -DPROG_NAME=\"$(PROG)\" -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)$(EXE)\"
-dbg/txr.o: CFLAGS += -DPROG_NAME=\"$(PROG)-dbg\" -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)-dbg$(EXE)\"
-$(call EACH_CONF,txr.o): CFLAGS += -DEXE_SUFF=\"$(EXE)\"
-$(call EACH_CONF,txr.o): CFLAGS += -DTXR_VER=\"$(txr_ver)\"
+opt/txr.o: CFLAGS += -DPROG_NAME=\"$(PROG)\" \
+ -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)$(EXE)\"
+dbg/txr.o: CFLAGS += -DPROG_NAME=\"$(PROG)-dbg\" \
+ -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)-dbg$(EXE)\"
+opt/txr-win.o: CFLAGS += -DPROG_NAME=\"$(PROG)-win\" \
+ -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)-win$(EXE)\"
+dbg/txr-win.o: CFLAGS += -DPROG_NAME=\"$(PROG)-win-dbg\" \
+ -DTXR_REL_PATH=\"$(bindir_rel)/$(PROG)-win-dbg$(EXE)\"
+$(call EACH_CONF,txr.o txr-win.o): CFLAGS += -DEXE_SUFF=\"$(EXE)\"
+$(call EACH_CONF,txr.o txr-win.o): CFLAGS += -DTXR_VER=\"$(txr_ver)\"
$(call EACH_CONF,$(MPI_OBJS)): CFLAGS += -DXMALLOC=chk_malloc -DXREALLOC=chk_realloc
$(call EACH_CONF,$$(MPI_OBJS)): CFLAGS += -DXCALLOC=chk_calloc -DXFREE=free
diff --git a/inst.nsi b/inst.nsi
index e774d910..0d2ca082 100644
--- a/inst.nsi
+++ b/inst.nsi
@@ -40,6 +40,7 @@ section "TXR"
SetShellVarContext current
SetOutPath $INSTDIR\txr\bin
File txr.exe
+ File txr-win.exe
SetOutPath $INSTDIR\txr\doc
File txr-manpage.html
File txr-manpage.pdf