]> Nishi Git Mirror - dataworks.git/commitdiff
better platform
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 16 May 2024 23:31:53 +0000 (23:31 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 16 May 2024 23:31:53 +0000 (23:31 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@10 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

GNUmakefile
Library/Makefile
Library/dataworks.c
Makefile

index 74060d3f73f1149a294d82629f72abd21e78ecd6..56b94461c80eb6c1021a35354d62ab0ce7922e82 100644 (file)
@@ -6,12 +6,14 @@ LIBS =
 LIB_PREFIX = lib
 LIB_SUFFIX = .so
 EXEC_SUFFIX =
+PLATFORM_M = `uname -m`
+PLATFORM_P = `uname -p`
 
 ifneq ("$(PLATFORM)", "")
 include Platforms/$(PLATFORM).mk
 endif
 
-COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)"
+COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)" PLATFORM_M="$(PLATFORM_M)" PLATFORM_P="$(PLATFORM_P)"
 
 .PHONY: all no-doc replace format clean ./Library ./Client ./Document
 
index 390ab507e5ac092de3adaa052795e7c24a64d950..dd91494abf265b703cad8f44963572502bd39a31 100644 (file)
@@ -11,7 +11,7 @@ $(LIB_PREFIX)dataworks$(LIB_SUFFIX): $(OBJS)
        $(CC) -shared $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 
 .c.o:
-       $(CC) $(CFLAGS) -fPIC -c -o $@ $<
+       $(CC) $(CFLAGS) -DPLATFORM_M=\"$(PLATFORM_M)\" -DPLATFORM_P=\"$(PLATFORM_P)\" -fPIC -c -o $@ $<
 
 clean:
        rm -f *.o *.so *.dll
index eab3582a16f3cfcc62437f6fed21d53beea65ee6..899d43ed1957c2531bfaac11158ec5b3f6d1e5ff 100644 (file)
@@ -32,14 +32,15 @@ const char* dataworks_version = "0.0.0";
 const char* dataworks_compile_date = __DATE__;
 
 #if defined(__MINGW32__)
-const char* dataworks_platform = "Windows";
+const char* dataworks_platform = "Windows/"
 #elif defined(__NetBSD__)
-const char* dataworks_platform = "NetBSD";
+const char* dataworks_platform = "NetBSD/"
 #elif defined(__linux__)
-const char* dataworks_platform = "Linux";
+const char* dataworks_platform = "Linux/"
 #else
-const char* dataworks_platform = "Unknown";
+const char* dataworks_platform = "Unknown/"
 #endif
+PLATFORM_M " (" PLATFORM_P ")";
 
 const char* dataworks_get_version(void) { return dataworks_version; }
 const char* dataworks_get_compile_date(void) { return dataworks_compile_date; }
index d6da39df0e1a9b1986b1a6ae783887ab5388695f..be92580c1136923739f34df2f594424c11e3f07d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,14 @@ LIBS =
 LIB_PREFIX = lib
 LIB_SUFFIX = .so
 EXEC_SUFFIX =
+PLATFORM_M = `uname -m`
+PLATFORM_P = `uname -p`
 
 .if "$(PLATFORM)" != ""
 .include Platforms/$(PLATFORM).mk
 .endif
 
-COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)"
+COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)" PLATFORM_M="$(PLATFORM_M)" PLATFORM_P="$(PLATFORM_P)"
 
 .PHONY: all no-doc replace format clean ./Library ./Client ./Document