From dce2a46f742a54c88895cff850f6dea5015700ed Mon Sep 17 00:00:00 2001 From: Stefan Begerad Date: Wed, 15 Mar 2023 15:38:35 +0100 Subject: [PATCH] feat(lib-version): initial commit --- lib-version/main.c | 8 ++++++++ lib-version/makefile | 24 ++++++++++++++++++++++++ lib-version/makefile-fine | 21 +++++++++++++++++++++ lib-version/makefile-fine2 | 24 ++++++++++++++++++++++++ lib-version/readme.md | 11 +++++++++++ 5 files changed, 88 insertions(+) create mode 100644 lib-version/main.c create mode 100644 lib-version/makefile create mode 100644 lib-version/makefile-fine create mode 100644 lib-version/makefile-fine2 create mode 100644 lib-version/readme.md diff --git a/lib-version/main.c b/lib-version/main.c new file mode 100644 index 0000000..bc184b8 --- /dev/null +++ b/lib-version/main.c @@ -0,0 +1,8 @@ +#include +#include +int main() { + /*return version of libpq*/ + int lib_ver = PQlibVersion(); + printf("Version of libpq: %d\n", lib_ver); + return 0; +} diff --git a/lib-version/makefile b/lib-version/makefile new file mode 100644 index 0000000..b14baca --- /dev/null +++ b/lib-version/makefile @@ -0,0 +1,24 @@ +# Docu +# +#$@ is the name of the file to be made +#$? is the names of the changed dependents +#$< the name of the related file that caused the action +#$* the prefix shared by target and dependent files +# +# Others +RM = /bin/rm -f +# +# Source, Executable, Includes, Library Defines +EXE = main +# +# Compiler, Linker Defines +CC = /usr/bin/gcc +# +all: main.o + $(CC) main.c -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq -std=c99 -Wall -o $(EXE) +# +main.o: + $(CC) -c main.c -I/usr/include/postgresql +# Clean Up Objects, Exectuables, Dumps out of source directory +clean: + $(RM) *.o $(EXE) *~ diff --git a/lib-version/makefile-fine b/lib-version/makefile-fine new file mode 100644 index 0000000..616581c --- /dev/null +++ b/lib-version/makefile-fine @@ -0,0 +1,21 @@ +# Docu +# +#$@ is the name of the file to be made +#$? is the names of the changed dependents +#$< the name of the related file that caused the action +#$* the prefix shared by target and dependent files +# +# Others +RM = /bin/rm -f +# +# Source, Executable, Includes, Library Defines +EXE = main +# +# Compiler, Linker Defines +CC = /usr/bin/gcc +# +all: + $(CC) main.c -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq -std=c99 -Wall -o $(EXE) +# Clean Up Objects, Exectuables, Dumps out of source directory +clean: + $(RM) *.o $(EXE) *~ diff --git a/lib-version/makefile-fine2 b/lib-version/makefile-fine2 new file mode 100644 index 0000000..b14baca --- /dev/null +++ b/lib-version/makefile-fine2 @@ -0,0 +1,24 @@ +# Docu +# +#$@ is the name of the file to be made +#$? is the names of the changed dependents +#$< the name of the related file that caused the action +#$* the prefix shared by target and dependent files +# +# Others +RM = /bin/rm -f +# +# Source, Executable, Includes, Library Defines +EXE = main +# +# Compiler, Linker Defines +CC = /usr/bin/gcc +# +all: main.o + $(CC) main.c -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq -std=c99 -Wall -o $(EXE) +# +main.o: + $(CC) -c main.c -I/usr/include/postgresql +# Clean Up Objects, Exectuables, Dumps out of source directory +clean: + $(RM) *.o $(EXE) *~ diff --git a/lib-version/readme.md b/lib-version/readme.md new file mode 100644 index 0000000..8156961 --- /dev/null +++ b/lib-version/readme.md @@ -0,0 +1,11 @@ +* build instruction + +``` +make +``` + +* run + +``` +./main +```