From 4cee177ceacc29813673f338b6baa2a0f9d2bc95 Mon Sep 17 00:00:00 2001 From: nishi Date: Mon, 29 Jan 2024 03:38:43 +0000 Subject: [PATCH] fix the makefile git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@132 d27a3e52-49c5-7645-884c-6793ebffc270 --- Example/Makefile | 24 ++++++++++++------------ Example/fetch/Makefile | 2 +- Example/interactive/Makefile | 2 +- Example/pop3-list/Makefile | 2 +- Example/w3b/Makefile | 2 +- Example/w3b/w3b.c | 5 ++++- Makefile | 2 +- 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Example/Makefile b/Example/Makefile index 49d7a5c..6c58b35 100644 --- a/Example/Makefile +++ b/Example/Makefile @@ -6,20 +6,20 @@ $(WINDRES) $< -O coff -o $@ examples: - $(MAKE) -C ./fetch CC=$(CC) - $(MAKE) -C ./interactive CC=$(CC) - $(MAKE) -C ./pop3-list CC=$(CC) - $(MAKE) -C ./w3b CC=$(CC) + $(MAKE) -C ./fetch CC=$(CC) SUFFIX=$(SUFFIX) + $(MAKE) -C ./interactive CC=$(CC) SUFFIX=$(SUFFIX) + $(MAKE) -C ./pop3-list CC=$(CC) SUFFIX=$(SUFFIX) + $(MAKE) -C ./w3b CC=$(CC) SUFFIX=$(SUFFIX) install: - $(MAKE) -C ./fetch CC=$(CC) PREFIX=$(PREFIX) install - $(MAKE) -C ./interactive CC=$(CC) PREFIX=$(PREFIX) install - $(MAKE) -C ./pop3-list CC=$(CC) PREFIX=$(PREFIX) install - $(MAKE) -C ./w3b CC=$(CC) PREFIX=$(PREFIX) install + $(MAKE) -C ./fetch CC=$(CC) PREFIX=$(PREFIX) SUFFIX=$(SUFFIX) install + $(MAKE) -C ./interactive CC=$(CC) PREFIX=$(PREFIX) SUFFIX=$(SUFFIX) install + $(MAKE) -C ./pop3-list CC=$(CC) PREFIX=$(PREFIX) SUFFIX=$(SUFFIX) install + $(MAKE) -C ./w3b CC=$(CC) PREFIX=$(PREFIX) SUFFIX=$(SUFFIX) install clean: rm -f *.o *.so *.core *~ *.exe *.res - $(MAKE) -C ./fetch clean - $(MAKE) -C ./interactive clean - $(MAKE) -C ./pop3-list clean - $(MAKE) -C ./w3b clean + $(MAKE) -C ./fetch SUFFIX=$(SUFFIX) clean + $(MAKE) -C ./interactive SUFFIX=$(SUFFIX) clean + $(MAKE) -C ./pop3-list SUFFIX=$(SUFFIX) clean + $(MAKE) -C ./w3b SUFFIX=$(SUFFIX) clean diff --git a/Example/fetch/Makefile b/Example/fetch/Makefile index 3de3103..e9ecb83 100644 --- a/Example/fetch/Makefile +++ b/Example/fetch/Makefile @@ -1,7 +1,7 @@ # $Id$: .PHONY: clean install -./fetch: ./fetch.c $(RESFILE) +./fetch$(SUFFIX): ./fetch.c $(RESFILE) $(CC) -g -o $@ -I ../../Library -L ../../Library $^ -lw3 ../libw3.res: diff --git a/Example/interactive/Makefile b/Example/interactive/Makefile index a961e94..3f3b4a2 100644 --- a/Example/interactive/Makefile +++ b/Example/interactive/Makefile @@ -1,7 +1,7 @@ # $Id$ .PHONY: clean install -./interactive: ./interactive.o $(RESFILE) +./interactive$(SUFFIX): ./interactive.o $(RESFILE) $(CC) -g -o $@ -L ../../Library $^ -lw3 ./%.o: ./%.c diff --git a/Example/pop3-list/Makefile b/Example/pop3-list/Makefile index 2b6a5df..b289ea3 100644 --- a/Example/pop3-list/Makefile +++ b/Example/pop3-list/Makefile @@ -1,7 +1,7 @@ # $Id$ .PHONY: clean install -./pop3-list: ./pop3-list.o $(RESFILE) +./pop3-list$(SUFFIX): ./pop3-list.o $(RESFILE) $(CC) -g -o $@ -L ../../Library $^ -lw3 ./%.o: ./%.c diff --git a/Example/w3b/Makefile b/Example/w3b/Makefile index e811bca..4cad268 100644 --- a/Example/w3b/Makefile +++ b/Example/w3b/Makefile @@ -1,7 +1,7 @@ # $Id$ .PHONY: clean install -./w3b: ./w3b.o $(RESFILE) +./w3b$(SUFFIX): ./w3b.o $(RESFILE) $(CC) -g -o $@ -L ../../Library $^ -lw3 ./%.o: ./%.c diff --git a/Example/w3b/w3b.c b/Example/w3b/w3b.c index 0ed391f..8927089 100644 --- a/Example/w3b/w3b.c +++ b/Example/w3b/w3b.c @@ -262,7 +262,10 @@ void render_site() { sprintf(seq, "\x1b[1;%dH", termw - strlen(titlebuf != NULL ? titlebuf : "No title") - 1); #ifdef __MINGW32__ DWORD written = 0; - WriteConsole(winstdout, seq, strlen(seq), &written, NULL); + char* str = malloc(strlen(seq) + 512); + sprintf(str, "%s\x1b[7m %s \x1b[m", seq, titlebuf != NULL ? titlebuf : "No title"); + WriteConsole(winstdout, str, strlen(str), &written, NULL); + free(str); #else printf("%s\x1b[7m %s \x1b[m", seq, titlebuf != NULL ? titlebuf : "No title"); fflush(stdout); diff --git a/Makefile b/Makefile index 0e5fa64..6b68650 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ all: ./w3.pc ./Library/W3Version.h $(ALL) $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES ./Example: ./Library/w3.dll - $(MAKE) -C ./Example CC=$(CC) examples + $(MAKE) -C ./Example CC=$(CC) examples SUFFIX=.exe ./Library/W3Version.h: m4 -DSUFFIX=\"W\" ./W3Version.h.p > $@ -- 2.43.0