init project #1

Merged
zeekling merged 1 commits from init_pro into master 2022-05-08 12:20:56 +00:00
5 changed files with 1596 additions and 0 deletions
Showing only changes of commit 7568057b36 - Show all commits

2
.gitignore vendored
View File

@ -107,3 +107,5 @@ dkms.conf
*.out
*.app
*.xo
*.so

11
Makefile Normal file
View File

@ -0,0 +1,11 @@
default: all
.DEFAULT:
cd src && $(MAKE) $@
install:
cd src && $(MAKE) $@
.PHONY: install

28
src/Makefile Normal file
View File

@ -0,0 +1,28 @@
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
# Compile flags for linux / osx
ifeq ($(uname_S),Linux)
SHOBJ_CFLAGS ?= -W -Wall -fno-common -g -ggdb -std=c99 -O2
SHOBJ_LDFLAGS ?= -shared
else
SHOBJ_CFLAGS ?= -W -Wall -dynamic -fno-common -g -ggdb -std=c99 -O2
SHOBJ_LDFLAGS ?= -bundle -undefined dynamic_lookup
endif
.SUFFIXES: .c .so .xo .o
.c.xo:
$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
all: redis-acl.so
redis-acl.xo: ./redismodule.h
redis-acl.so: redis-acl.xo
$(LD) -o $@ $^ $(SHOBJ_LDFLAGS) $(LIBS) -lc
clean:
rm -rf *.xo *.so

7
src/redis-acl.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
#include "redismodule.h"
int main(){
printf("Hello world\n");
return 0;
}

1548
src/redismodule.h Normal file

File diff suppressed because it is too large Load Diff