From f8e9fc261645d81e8311242d5b59cd0bd62111b3 Mon Sep 17 00:00:00 2001 From: nishi Date: Thu, 16 May 2024 12:41:07 +0000 Subject: [PATCH] add files git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@3 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Client/Makefile | 17 +++++++++++++++++ Client/main.c | 11 +++++++++++ Document/Doxyfile | 29 +++++++++++++++++++++++++++++ Document/Makefile | 10 ++++++++++ Document/index.md | 7 +++++++ Library/Makefile | 4 ++-- Library/dataworks.c | 11 +++++++++++ Library/dataworks.h | 39 +++++++++++++++++++++++++++++++++++++++ Makefile | 19 +++++++++++++++---- Platforms/win32.mk | 1 + Platforms/win64.mk | 1 + dataworks.png | Bin 0 -> 1279 bytes 12 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 Client/Makefile create mode 100644 Client/main.c create mode 100644 Document/Doxyfile create mode 100644 Document/Makefile create mode 100644 Document/index.md create mode 100644 Library/dataworks.c create mode 100644 Library/dataworks.h create mode 100644 dataworks.png diff --git a/Client/Makefile b/Client/Makefile new file mode 100644 index 0000000..669ad72 --- /dev/null +++ b/Client/Makefile @@ -0,0 +1,17 @@ +# $Id$ + +.PHONY: all clean +.SUFFIXES: .c .o + +OBJS = main.o + +all: dataworks$(EXEC_SUFFIX) + +dataworks$(EXEC_SUFFIX): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -ldataworks + +.c.o: + $(CC) -I../Library $(CFLAGS) -c -o $@ $< + +clean: + rm -f *.o dataworks *.exe diff --git a/Client/main.c b/Client/main.c new file mode 100644 index 0000000..44df3f9 --- /dev/null +++ b/Client/main.c @@ -0,0 +1,11 @@ +/* $Id$ */ +/* --- START LICENSE --- */ +/* --- END LICENSE --- */ + +#include + +#include + +int main(int argc, char** argv){ + printf("DataWorks %s\n", dataworks_get_version()); +} diff --git a/Document/Doxyfile b/Document/Doxyfile new file mode 100644 index 0000000..645b8c7 --- /dev/null +++ b/Document/Doxyfile @@ -0,0 +1,29 @@ +# $Id$ + +PROJECT_NAME = DataWorks +OUTPUT_DIRECTORY = doc +TAB_SIZE = 8 +OPTIMIZE_OUTPUT_FOR_C = YES +MARKDOWN_SUPPORT = YES +EXTRACT_ALL = NO +FILE_PATTERNS = *.h *.c +INPUT = ../Library +SOURCE_BROWSER = YES +HTML_DYNAMIC_MENUS = YES +GENERATE_TREEVIEW = YES +EXCLUDE_SYMBOLS = __* +FULL_SIDEBAR = NO +DISABLE_INDEX = NO +PROJECT_LOGO = ../dataworks.png +PROJECT_BRIEF = Database Library/Client +GENERATE_MAN = YES +MAN_OUTPUT = man +HTML_OUTPUT = html +INPUT += index.md +USE_MDFILE_AS_MAINPAGE = index.md +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = ../Library/ +IMAGE_PATH = .. +ENABLED_SECTIONS = YES +OUTPUT_LANGUAGE = English +GENERATE_LATEX = NO diff --git a/Document/Makefile b/Document/Makefile new file mode 100644 index 0000000..798af07 --- /dev/null +++ b/Document/Makefile @@ -0,0 +1,10 @@ +# $Id$ + +.PHONY: all clean document +all: document + +document: + doxygen + +clean: + rm -rf doc diff --git a/Document/index.md b/Document/index.md new file mode 100644 index 0000000..e060229 --- /dev/null +++ b/Document/index.md @@ -0,0 +1,7 @@ +# Abstract {#mainpage} + +**DataWorks** is a general-purpose and platform independent database library/client. + +## License + +**DataWorks** is free software, and sources are published under 3-clause BSD License. diff --git a/Library/Makefile b/Library/Makefile index 98c6b99..64338c4 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -3,7 +3,7 @@ .PHONY: all clean .SUFFIXES: .c .o -OBJS = parser.o +OBJS = parser.o dataworks.o all: $(LIB_PREFIX)dataworks$(LIB_SUFFIX) @@ -14,4 +14,4 @@ $(LIB_PREFIX)dataworks$(LIB_SUFFIX): $(OBJS) $(CC) $(CFLAGS) -fPIC -c -o $@ $< clean: - rm -f *.o $(LIB_PREFIX)dataworks$(LIB_SUFFIX) + rm -f *.o *.so *.dll diff --git a/Library/dataworks.c b/Library/dataworks.c new file mode 100644 index 0000000..ad11ac2 --- /dev/null +++ b/Library/dataworks.c @@ -0,0 +1,11 @@ +/* $Id$ */ +/* --- START LICENSE --- */ +/* --- END LICENSE --- */ + +#include "dataworks.h" + +const char* dataworks_version = DATAWORKS_VERSION; + +const char* dataworks_get_version(void){ + return dataworks_version; +} diff --git a/Library/dataworks.h b/Library/dataworks.h new file mode 100644 index 0000000..eecb64f --- /dev/null +++ b/Library/dataworks.h @@ -0,0 +1,39 @@ +/* $Id$ */ +/* --- START LICENSE --- */ +/* --- END LICENSE --- */ + +#ifndef __DATAWORKS_DATAWORKS_H__ +#define __DATAWORKS_DATAWORKS_H__ + +/** + * @file dataworks.h + * @~english + * @brief DataWorks info + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @~english + * @brief Version of DataWorks + * @note Use dataworks_get_version. + * + */ +#define DATAWORKS_VERSION "0.0.0" + +/** + * @~english + * @brief Get the version of DataWorks + * @return Version of DataWorks + * + */ +const char* dataworks_get_version(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Makefile b/Makefile index 27ee9e1..6d253a6 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,33 @@ # $Id$ CC = cc CFLAGS = -std=c99 -LDFLAGS = +LDFLAGS = -L`pwd`/Library LIBS = LIB_PREFIX = lib LIB_SUFFIX = .so +EXEC_SUFFIX = .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)" +COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)" -.PHONY: all replace format clean ./Library +.PHONY: all no-doc replace format clean ./Library ./Client ./Document -all: ./Library +all: ./Library ./Client ./Document + +no-doc: ./Library ./Client ./Library:: $(MAKE) -C $@ $(COMPILE_FLAGS) +./Client:: ./Library + $(MAKE) -C $@ $(COMPILE_FLAGS) + +./Document:: + $(MAKE) -C ./Document $(COMPILE_FLAGS) + FILES = `find . -name "*.c" -or -name "*.h"` replace: @@ -34,3 +43,5 @@ format: clean: $(MAKE) -C ./Library clean $(COMPILE_FLAGS) + $(MAKE) -C ./Client clean $(COMPILE_FLAGS) + $(MAKE) -C ./Document clean $(COMPILE_FLAGS) diff --git a/Platforms/win32.mk b/Platforms/win32.mk index 7731baf..db18743 100644 --- a/Platforms/win32.mk +++ b/Platforms/win32.mk @@ -1,3 +1,4 @@ CC = i686-w64-mingw32-gcc LIB_PREFIX = LIB_SUFFIX = .dll +EXEC_SUFFIX = .exe diff --git a/Platforms/win64.mk b/Platforms/win64.mk index aa1d938..dd6531e 100644 --- a/Platforms/win64.mk +++ b/Platforms/win64.mk @@ -1,3 +1,4 @@ CC = x86_64-w64-mingw32-gcc LIB_PREFIX = LIB_SUFFIX = .dll +EXEC_SUFFIX = .exe diff --git a/dataworks.png b/dataworks.png new file mode 100644 index 0000000000000000000000000000000000000000..07cff8f7784228033f04b230509ff39abf2995b5 GIT binary patch literal 1279 zcmVEX>4Tx04R}tkv&MmKpe$iQ%glF3U&~2$WWcyMWr}u6^c-y)C#RSm|Xe=O&XFE z7e~Rh;NZt%)xpJCR|i)?5c~jfc5qU3krMxx6k5c1aNLh~_a1le0HIlBs@XFOsG4PD zk_j=FUloI|2w({Ph$AX7Q=dzxQ}7&L_we!cF2=LG&;2Wt02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00P%ZL_t(|+U;B2&cZMV9bbH-UHguEC$INR{chF-8Bj{8 za|RM)tc7))9)3E7Wl+|2E!_CN@35pykw=7)=f1yveywYI_S-;{*d@(L*2N0+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