feat(lib-version): initial commit

This commit is contained in:
dancingCycle 2023-03-15 15:38:35 +01:00
parent dd6a6b12e3
commit dce2a46f74
5 changed files with 88 additions and 0 deletions

8
lib-version/main.c Normal file
View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include <libpq-fe.h>
int main() {
/*return version of libpq*/
int lib_ver = PQlibVersion();
printf("Version of libpq: %d\n", lib_ver);
return 0;
}

24
lib-version/makefile Normal file
View File

@ -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) *~

21
lib-version/makefile-fine Normal file
View File

@ -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) *~

View File

@ -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) *~

11
lib-version/readme.md Normal file
View File

@ -0,0 +1,11 @@
* build instruction
```
make
```
* run
```
./main
```