Test lib with makefile
640*480*4 bytes are a lot to process one-by-one
This commit is contained in:
parent
dea4205a0e
commit
cc7cd15efa
4 changed files with 47 additions and 0 deletions
3
libpxc/.gitignore
vendored
Normal file
3
libpxc/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
obj/
|
||||
out/
|
||||
|
10
libpxc/makefile
Normal file
10
libpxc/makefile
Normal file
|
@ -0,0 +1,10 @@
|
|||
CC=gcc
|
||||
# CFLAGS=-I.
|
||||
|
||||
pxct: pxct.c pxc
|
||||
$(CC) -Wall pxct.c -Lout -lpxc -Wl,-rpath=out -o out/pxct
|
||||
|
||||
pxc: pxc.c
|
||||
$(CC) -Wall -c -fpic pxc.c -o obj/pxc.o
|
||||
$(CC) -Wall -shared obj/pxc.o -o out/libpxc.so
|
||||
|
19
libpxc/pxc.c
Normal file
19
libpxc/pxc.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int convert(int px[], int *out[]) {
|
||||
printf("convert...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __attribute__ ((constructor)) initLibrary(void) {
|
||||
//
|
||||
// Function that is called when the library is loaded
|
||||
//
|
||||
printf("Library is initialized\n");
|
||||
}
|
||||
void __attribute__ ((destructor)) cleanUpLibrary(void) {
|
||||
//
|
||||
// Function that is called when the library is »closed«.
|
||||
//
|
||||
printf("Library is exited\n");
|
||||
}
|
15
libpxc/pxct.c
Normal file
15
libpxc/pxct.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdio.h>
|
||||
|
||||
/* https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
|
||||
gcc -Wall -c -fpic pxc.c
|
||||
gcc -Wall -shared pxc.o -o pxc.so
|
||||
gcc -Wall pxct.c -L. -lpxc -Wl,-rpath=.
|
||||
*/
|
||||
|
||||
int convert(int px[], int *out[]);
|
||||
|
||||
int main() {
|
||||
convert(NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue