From 51aaba7cc9917d51aa55adab45aa96c092c58b5b Mon Sep 17 00:00:00 2001 From: nishi Date: Thu, 18 Jan 2024 10:49:25 +0000 Subject: [PATCH] the thing git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@27 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/W3Core.h | 2 +- Makefile | 12 +++++++++--- W3Version.h.p | 8 ++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 W3Version.h.p diff --git a/Library/W3Core.h b/Library/W3Core.h index 6b18524..d7033e6 100644 --- a/Library/W3Core.h +++ b/Library/W3Core.h @@ -4,7 +4,7 @@ #include -#define LIBW3_VERSION "0.0" +#include "W3Version.h" struct W3 { int sock; /* Socket */ diff --git a/Makefile b/Makefile index 2f2a1ed..460e5a9 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ifdef WINDOWS ALL := ./Library/w3.dll ./Example/fetch.exe -all: ./w3.pc $(ALL) +all: ./w3.pc ./Library/W3Version.h $(ALL) ./Library/w3.dll: $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" WINDOWS=YES @@ -44,13 +44,16 @@ all: ./w3.pc $(ALL) ./Example/fetch.exe: ./Library/w3.dll $(MAKE) -C ./Example CC=$(CC) fetch +./Library/W3Version.h: + m4 -DSUFFIX=\"/W\" ./W3Version.h.p > $@ + else .PHONY: all clean ./Library/libw3.so ./Example/fetch ALL := ./Library/libw3.so ./Example/fetch -all: ./w3.pc $(ALL) +all: ./w3.pc ./Library/W3Version.h $(ALL) ./Library/libw3.so: $(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" @@ -58,6 +61,9 @@ all: ./w3.pc $(ALL) ./Example/fetch: ./Library/libw3.so $(MAKE) -C ./Example CC=$(CC) fetch +./Library/W3Version.h: + m4 -DSUFFIX=\"\" ./W3Version.h.p > $@ + endif ./w3.pc: @@ -73,7 +79,7 @@ endif echo "Libs: -I\$${libdir} -lw3" >> $@ clean: - -rm ./w3.pc *.zip *.tar.gz + -rm ./w3.pc *.zip *.tar.gz ./Library/W3Version.h $(MAKE) -C ./Library clean $(MAKE) -C ./Example clean diff --git a/W3Version.h.p b/W3Version.h.p new file mode 100644 index 0000000..8cb59a0 --- /dev/null +++ b/W3Version.h.p @@ -0,0 +1,8 @@ +/* $Id$ */ +#ifndef __W3VERSION_H__ +#define __W3VERSION_H__ + +#define LIBW3_VERSION "0.0" \ +SUFFIX + +#endif -- 2.43.0