]> Nishi Git Mirror - dataworks.git/commitdiff
add vbcc
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 19 Jun 2024 12:25:25 +0000 (12:25 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 19 Jun 2024 12:25:25 +0000 (12:25 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@365 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Grammar/Makefile
Grammar/dw.l
Library/Makefile
Library/dataworks.c
Library/util.c
Makefiles/Platforms/amigaos.mk [new file with mode: 0644]
Makefiles/Platforms/vbcc.mk [new file with mode: 0644]
Makefiles/Platforms/watcom.mk
Makefiles/common-decl.mk

index 99a26b5ed82357201586ca38b82f8a5b84e3e844..d9edc357284b4a235fc9d67c2dfea5dfc5cb21a0 100644 (file)
@@ -6,7 +6,7 @@
 all: dw.tab.o dw.yy.o
 
 .c.o:
-       $(CC) $(CFLAGS) -fPIC -c -o $@ $<
+       $(CC) $(CFLAGS) $(PIC) -c -o $@ $<
 
 dw.tab.c: dw.y
        $(YACC) $(YFLAGS) -o $@ dw.y
index 0e0862783396a24301e18159e824f31f93850e5a..6d4af1d77113b0a3f814f07d83671625397f7f12 100644 (file)
@@ -37,6 +37,21 @@ extern YYSTYPE yylval;
 
 double __dw_atof(const char* str);
 char* __dw_strcat(const char* a, const char* b);
+char* __dw_strdup(const char* a);
+
+#ifdef NO_STRDUP
+#define strdup __dw_strdup
+#endif
+
+#ifdef __VBCC__
+int isatty(int fd){
+       return 0;
+}
+int fileno(FILE* fp){
+       return 0;
+}
+#endif
+
 char* str = NULL;
 
 void proc_esc(void){
index c0b4bd086bfd8f3a3ec3e6a2de2bfa9fc066d3d1..0c674e747d86316749b46816ef8bf1998a542150 100644 (file)
@@ -15,7 +15,7 @@ $(STATICLIB_PREFIX)dataworks$(STATICLIB_SUFFIX): $(OBJS)
        $(RANLIB) $@
 
 .c.o:
-       $(CC) $(CFLAGS) -DPLATFORM_M=\"$(PLATFORM_M)\" -DPLATFORM_P=\"$(PLATFORM_P)\" -fPIC -c -o $@ $<
+       $(CC) $(CFLAGS) -DPLATFORM_M=\"$(PLATFORM_M)\" -DPLATFORM_P=\"$(PLATFORM_P)\" $(PIC) -c -o $@ $<
 
 clean:
        rm -f *.o *.so *.dll *.a *.lib
index a32078c24b500cc29f03459a8da9dd3cc6649d9f..deb6ed4c59ea8b33b9532ff733d2f1dbc27cf3a1 100644 (file)
@@ -54,11 +54,23 @@ const char* dataworks_platform = "Linux/"
 const char* dataworks_platform = "WatcomC/"
 #elif defined(__APPLE__)
 const char* dataworks_platform = "MacOSX/"
+#elif defined(__VBCC__)
+#undef SUPPORTED
+const char* dataworks_platform = "VBCC/"
 #else
 #undef SUPPORTED
 const char* dataworks_platform = "Unknown/"
 #endif
+#ifdef __VBCC__
+#ifdef AMIGA
+    "amiga (amiga)";
+#else
+    "unknown (unknown)";
+#endif
+;
+#else
     PLATFORM_M " (" PLATFORM_P ")";
+#endif
 
 extern const char* yaccver;
 extern const char* lexver;
index 9fa4abf8a1a181f3de0944d30d224f9a1b1305da..fd9b813d059a33bcd4dafba3997fd8dcf55c6a7d 100644 (file)
 #ifdef __MINGW32__
 #include <fileapi.h>
 #else
+#ifndef NO_UNISTD
 #include <unistd.h>
 #endif
+#endif
 
 char* __dw_strdup(const char* a) {
        char* str = malloc(strlen(a) + 1);
@@ -73,6 +75,8 @@ bool __dw_lockfile(struct dataworks_db* db) {
        fseek(db->fp, 0, SEEK_SET);
 #if defined(__WATCOMC__)
 
+#elif defined(__VBCC__)
+
 #elif defined(__MINGW32__)
        OVERLAPPED overlap = {0};
        LockFileEx(db->fp, LOCKFILE_EXCLUSIVE_LOCK, 0, MAXDWORD, MAXDWORD, &overlap);
@@ -93,6 +97,8 @@ bool __dw_unlockfile(struct dataworks_db* db) {
        fflush(db->fp);
 #if defined(__WATCOMC__)
 
+#elif defined(__VBCC__)
+
 #elif defined(__MINGW32__)
        OVERLAPPED overlap = {0};
        UnlockFileEx(db->fp, 0, MAXDWORD, MAXDWORD, &overlap);
diff --git a/Makefiles/Platforms/amigaos.mk b/Makefiles/Platforms/amigaos.mk
new file mode 100644 (file)
index 0000000..50718de
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id$
+
+VBCC_PLATFORM=kick13
+include Makefiles/Platforms/vbcc.mk
+LIBS = -lmsoft
+EXEC_SUFFIX=
+RCLI=
+SERVER=
+SERVER_MODULE = hayes.o
+RCLI_MODULE = hayes.o
+CFLAGS += -DAMIGA
diff --git a/Makefiles/Platforms/vbcc.mk b/Makefiles/Platforms/vbcc.mk
new file mode 100644 (file)
index 0000000..d9ca77f
--- /dev/null
@@ -0,0 +1,21 @@
+# $Id$
+
+# THIS IS A TEMPLATE
+
+CC = vc
+SHCC = true
+AR = vlink
+AR_ARGS = -r -o \$$@
+RANLIB = true
+STDC99 = -c99
+PIC =
+LIB_PREFIX =
+LIB_SUFFIX = .dll
+EXEC_SUFFIX = .$(VBCC_PLATFORM)
+STATICLIB_PREFIX =
+STATICLIB_SUFFIX = .a
+PLATFORM_M = $(VBCC_PLATFORM)
+PLATFORM_P = $(VBCC_PLATFORM)
+CFLAGS += +$(VBCC_PLATFORM) -DNO_STRDUP -DNO_UNISTD -Doff_t=int64_t
+DFLAGS += +$(VBCC_PLATFORM) -DNO_STRDUP -DNO_UNISTD -Doff_t=int64_t
+LDFLAGS += +$(VBCC_PLATFORM)
index e686616a962dad33806890677724a5fd5bd10e43..68ec9927562d2503bf9c062e4de21e84e65bfc2b 100644 (file)
@@ -1,5 +1,7 @@
 # $Id$
 
+# THIS IS A TEMPLATE
+
 CC = owcc
 SHCC = true
 AR = wlib
index ffa45698c60f48ce70d344aa23cba90553f11786..d3f737c87b0a91bdabdfb7796a54153470e53668 100644 (file)
@@ -8,11 +8,13 @@ LEX = lex
 AR_ARGS = rcs \$$@
 RANLIB = ranlib
 WINDRES = windres
-CFLAGS = -g -std=c99 -D_DEFAULT_SOURCE $(DEBUGFLAGS)
+STDC99 = -std=c99
+CFLAGS = -g $(STDC99) -D_DEFAULT_SOURCE $(DEBUGFLAGS)
 LDFLAGS = -L`pwd`/Library $(MORE_LDFLAGS)
 YFLAGS = -d -t -y
-LFLAGS =
+LFLAGS = --nounistd
 LIBS =
+PIC = -fPIC
 LIB_PREFIX = lib
 LIB_SUFFIX = .so
 STATICLIB_PREFIX = lib
@@ -32,4 +34,4 @@ RCLI_MODULE = tcpip.o
 MD5SUM = md5sum
 VERSION = `cat Library/dataworks.c | grep " dataworks_version " | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?'`
 
-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)" STATICLIB_PREFIX="$(STATICLIB_PREFIX)" STATICLIB_SUFFIX="$(STATICLIB_SUFFIX)" AR="$(AR)" RANLIB="$(RANLIB)" SHCC="$(SHCC)" LINK_LIB="$(LINK_LIB)" AR_ARGS="$(AR_ARGS)" WINDRES="$(WINDRES)" YACC="$(YACC)" LEX="$(LEX)" LFLAGS="$(LFLAGS)" YFLAGS="$(YFLAGS)" SERVER_MODULE="$(SERVER_MODULE)" SERVLINK_LIB="$(SERVLINK_LIB)" RCLI_MODULE="$(RCLI_MODULE)" RCLILINK_LIB="$(RCLILINK_LIB)" INDEP="$(INDEP)" INDEP_TO="$(INDEP_TO)"
+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)" STATICLIB_PREFIX="$(STATICLIB_PREFIX)" STATICLIB_SUFFIX="$(STATICLIB_SUFFIX)" AR="$(AR)" RANLIB="$(RANLIB)" SHCC="$(SHCC)" LINK_LIB="$(LINK_LIB)" AR_ARGS="$(AR_ARGS)" WINDRES="$(WINDRES)" YACC="$(YACC)" LEX="$(LEX)" LFLAGS="$(LFLAGS)" YFLAGS="$(YFLAGS)" SERVER_MODULE="$(SERVER_MODULE)" SERVLINK_LIB="$(SERVLINK_LIB)" RCLI_MODULE="$(RCLI_MODULE)" RCLILINK_LIB="$(RCLILINK_LIB)" INDEP="$(INDEP)" INDEP_TO="$(INDEP_TO)" PIC="$(PIC)"