]> Nishi Git Mirror - libw3.git/commitdiff
the thing
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 18 Jan 2024 10:49:25 +0000 (10:49 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 18 Jan 2024 10:49:25 +0000 (10:49 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@27 d27a3e52-49c5-7645-884c-6793ebffc270

Library/W3Core.h
Makefile
W3Version.h.p [new file with mode: 0644]

index 6b185244d67c4c68605585e358370be89d7d9399..d7033e65c81e64176904aef29591649d2663d192 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <stdbool.h>
 
-#define LIBW3_VERSION "0.0"
+#include "W3Version.h"
 
 struct W3 {
        int sock;       /* Socket */
index 2f2a1eda1cf6de8e371bbe743aa5fb443f16dd0e..460e5a94b34306207ad6258934166a16dd53f6d9 100644 (file)
--- 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 (file)
index 0000000..8cb59a0
--- /dev/null
@@ -0,0 +1,8 @@
+/* $Id$ */
+#ifndef __W3VERSION_H__
+#define __W3VERSION_H__
+
+#define LIBW3_VERSION "0.0" \
+SUFFIX
+
+#endif